Tools
Proxy

Execute proxy request

Proxy an HTTP request to a third-party API using connected account credentials. This endpoint allows making authenticated API calls to external services while abstracting away authentication details. v3.1 requires a proxy_execute scoped project API key; default project API keys are rejected.

post/api/v3.1/tools/execute/proxy

Request body

connected_account_idstring connectedAccountId

The ID of the connected account to use for authentication (if not provided, will use the default account for the project)

endpointstring required

The API endpoint to call (absolute URL or path relative to base URL of the connected account)

method'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' required

The HTTP method to use for the request

{"stackTrail":"paths:/api/v3.1/tools/execute/proxy:post:requestBody:content:application/json:schema:properties:body","oasType":"schema","type":"unknown","description":"The request body (for POST, PUT, and PATCH requests)","example":{"name":"New Resource","description":"This is a new resource"},"nullable":true}

Example request

{
  "connected_account_id": "ca_1a2b3c4d5e6f",
  "endpoint": "/api/v1/resources",
  "method": "GET",
  "body": {
    "name": "New Resource",
    "description": "This is a new resource"
  },
  "parameters": [
    {
      "name": "x-api-key",
      "value": "abc123def456",
      "type": "header"
    },
    {
      "name": "filter",
      "value": "active",
      "type": "query"
    }
  ]
}

Response

Successfully executed proxy request and received response

{"stackTrail":"paths:/api/v3.1/tools/execute/proxy:post:responses:200:content:application/json:schema:properties:data","oasType":"schema","type":"unknown","description":"The response data returned from the proxied API","example":{"id":"123","name":"Resource Name","created_at":"2023-01-01T00:00:00Z"},"nullable":true}
statusnumber required

The HTTP status code returned from the proxied API

headersobject

The HTTP headers returned from the proxied API

Example response

{
  "data": {
    "id": "123",
    "name": "Resource Name",
    "created_at": "2023-01-01T00:00:00Z"
  },
  "status": 200,
  "headers": {
    "content-type": "application/json",
    "cache-control": "no-cache",
    "host": "api.example.com"
  }
}

Changes

Changed in 6 of the 61 revisions of this API.8

    • removed the non-success response with the status 502

      response-non-success-status-removed

    • removed the non-success response with the status 504

      response-non-success-status-removed

    • the request property custom_connection_data/oneOf[subschema #11]/val/client_id became optional

      request-property-became-optional

    • the request property custom_connection_data/oneOf[subschema #11]/val/client_secret became optional

      request-property-became-optional

    • the endpoint scheme security UserApiKeyAuth was removed from the API

      api-security-removed

    • the endpoint scheme security CookieAuth was removed from the API

      api-security-removed

    • added the new optional request property custom_connection_data/oneOf[subschema #1]/val/extra_token_data

      new-optional-request-property

    • endpoint added

      endpoint-added