> ## Documentation Index
> Fetch the complete documentation index at: https://docs.safefetch.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Retry Action

> Creates a new pending action from a failed/cancelled action.



## OpenAPI

````yaml POST /v1/actions/{id}/retry
openapi: 3.1.0
info:
  title: SafeFetch API
  version: 0.1.0
  description: >
    SafeFetch HTTP API for managing actions.


    SafeFetch is a safety layer for AI actions that makes reliable HTTP requests
    to any URL you specify

    — API endpoints, internal services, third-party APIs — with retries, HMAC
    signatures,

    and stored results.


    Notes:

    - All response/request fields are snake_case.

    - IDs are prefixed strings (for example: act_xxx, acct_xxx), not UUIDs.

    - `/v1/*` routes require `Authorization: Bearer <api_key>`.

    - `X-Request-Id` is returned on every response.
servers:
  - url: /
security: []
tags:
  - name: System
  - name: Auth
  - name: Actions
paths:
  /v1/actions/{id}/retry:
    post:
      tags:
        - Actions
      summary: Retry action
      description: Creates a new pending action from a failed/cancelled action.
      operationId: retryAction
      parameters:
        - $ref: '#/components/parameters/XRequestId'
        - $ref: '#/components/parameters/ActionId'
        - $ref: '#/components/parameters/ContentTypeJson'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
      responses:
        '201':
          description: Retry action created
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          content:
            application/json:
              schema:
                type: object
                required:
                  - id
                  - status
                  - created_at
                properties:
                  id:
                    $ref: '#/components/schemas/ActionId'
                  status:
                    type: string
                    const: pending
                  created_at:
                    type: string
                    format: date-time
        '400':
          $ref: '#/components/responses/MissingField'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '405':
          $ref: '#/components/responses/MethodNotAllowed'
        '409':
          $ref: '#/components/responses/NotRetryable'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '429':
          $ref: '#/components/responses/RateLimited'
      security:
        - BearerAuth: []
components:
  parameters:
    XRequestId:
      name: X-Request-Id
      in: header
      required: false
      description: Optional client request ID. Echoed back on response.
      schema:
        type: string
    ActionId:
      name: id
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/ActionId'
    ContentTypeJson:
      name: Content-Type
      in: header
      required: true
      schema:
        type: string
        pattern: ^application/json(;.*)?$
  headers:
    XRequestId:
      description: Request identifier, echoed from request or generated server-side.
      schema:
        type: string
        pattern: ^req_[A-Za-z0-9_-]+$
  schemas:
    ActionId:
      type: string
      pattern: ^act_[A-Za-z0-9_-]+$
      example: act_M4qT8YH7xW2pL9nB
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              enum:
                - missing_body
                - validation_error
                - missing_field
                - invalid_request
                - invalid_query
                - invalid_content_type
                - invalid_url
                - invalid_sync
                - unauthorized
                - rate_limited
                - payload_too_large
                - method_not_allowed
                - not_found
                - not_cancellable
                - not_approvable
                - not_retryable
                - email_taken
                - invalid_credentials
            message:
              type: string
            request_id:
              type: string
              pattern: ^req_[A-Za-z0-9_-]+$
            details:
              oneOf:
                - type: array
                  items:
                    $ref: '#/components/schemas/ValidationIssue'
                - type: object
                - type: string
    ValidationIssue:
      type: object
      required:
        - field
        - message
        - code
      properties:
        field:
          type: string
        message:
          type: string
        code:
          type: string
          const: invalid
  responses:
    MissingField:
      description: Missing required path field.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Missing or invalid bearer token.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Action not found.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    MethodNotAllowed:
      description: Method not allowed.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        Allow:
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotRetryable:
      description: Only failed or cancelled actions can be retried.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    PayloadTooLarge:
      description: Request body exceeds 1MB.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    RateLimited:
      description: Too many requests for current account.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        Retry-After:
          schema:
            type: string
            const: '1'
          description: Seconds until the rate-limit window resets.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key

````