RecoupGet a free auditFree audit

API REFERENCE

Upload Connector File

On this page
POST/api/connectors/files

Stage an image into Connector file storage so it can be attached to a connector action that accepts a file_uploadable field. The returned descriptor is embedded in a file_uploadable array on Execute Connector Action.

Authentication

x-api-key in header

bearerAuth bearer

Request

cURL
curl --request POST \
  --url 'https://api.recoupable.dev/api/connectors/files' \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "url": "string",
  "toolSlug": "string"
}'

Try it

Fill in the fields, send the request from your browser, and read the live response. The curl below updates as you type.

Kept in this browser tab only and cleared when it closes.

cURL for this request
curl --request POST \
  --url 'https://recoup-api.vercel.app/api/connectors/files' \
  --header 'Content-Type: application/json' \
  --data '{
  "url": "string",
  "toolSlug": "string"
}'

Request body required

The image URL to stage and the action it will be attached to.

application/json

urlstringrequired

Publicly reachable URL of the image to stage. Fetched server-side and uploaded to Connector storage. Required.

format: uri

toolSlugstringrequired

The action slug the image will be attached to, UPPERCASE_SNAKE_CASE (e.g. LINKEDIN_CREATE_LINKED_IN_POST). Scopes the upload to that tool/toolkit. Required.

Responses

200Image staged. Returns the Connector file descriptor to embed in the action's file_uploadable array.

application/json

successbooleanrequired
namestringrequired

Stored filename.

mimetypestringrequired

Detected MIME type of the stored file.

s3keystringrequired

Connector storage key. Pass this together with name and mimetype in the action's file_uploadable array.

400Bad request — missing or invalid url (must be a reachable URL) or toolSlug.

application/json

errorintegerrequired

format: int32

messagestringrequired
401Unauthorized — invalid or missing API key.

application/json

errorintegerrequired

format: int32

messagestringrequired
502Upstream failure staging the file into Connector storage (the image fetch failed or Connector errored).

application/json

errorintegerrequired

format: int32

messagestringrequired

Full specification

Download the OpenAPI file for complete schemas, constraints, and examples.

Download social.json
View operation source
json
{
  "security": [
    {
      "apiKeyAuth": []
    },
    {
      "bearerAuth": []
    }
  ],
  "description": "Stage an image into Connector file storage so it can be attached to a connector action that accepts a file_uploadable field. The returned descriptor is embedded in a file_uploadable array on [Execute Connector Action](/api-reference/connectors/execute-action).",
  "requestBody": {
    "description": "The image URL to stage and the action it will be attached to.",
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/UploadConnectorFileRequest"
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Image staged. Returns the Connector file descriptor to embed in the action's file_uploadable array.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/UploadConnectorFileResponse"
          }
        }
      }
    },
    "400": {
      "description": "Bad request — missing or invalid `url` (must be a reachable URL) or `toolSlug`.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "401": {
      "description": "Unauthorized — invalid or missing API key.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "502": {
      "description": "Upstream failure staging the file into Connector storage (the image fetch failed or Connector errored).",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    }
  }
}