Context4
Technical documentation

Connections and OAuth applications.

Context4 service connections and OAuth configurations: manage connected accounts and provider schemas through the API.

Generated from the public Context4 OpenAPI. Authenticate with Authorization: Bearer and an API key. General rules: API. Full contract: OpenAPI JSON. In the JSON below, $ref points to a named schema in the Schemas section.

listConnections

GET /v1/connections

Deployment URL: https://ctx4.me/v1/connections. Replace parameters in braces with actual IDs from the API.

List connections

Capability: connections:read.

Parameters

NameLocationRequiredType and constraints
statusqueryno{"type":"string","enum":["pending","active","degraded","revoked","failed"]}
user_idqueryno{"$ref":"#/components/schemas/EndUserRef"}
cursorqueryno{"type":"string","minLength":1,"maxLength":400,"pattern":"^[A-Za-z0-9_-]+$","description":"Opaque pagination cursor from a previous response"} Opaque pagination cursor from a previous response
limitqueryno{"type":"integer","minimum":1,"maximum":100,"description":"Page size (1-100, default 20)"} Page size (1-100, default 20)

Responses and errors

HTTPMeaningFormat and schema
200Connections in the key's workspaceapplication/json ConnectionListResponse
400Problem (validation_failed)application/problem+json Problem
401Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked)application/problem+json Problem
403Problem (capability_missing)application/problem+json Problem
429Problem (rate_limited)application/problem+json Problem
500Problem (internal)application/problem+json Problem
503Problem (service_unavailable)application/problem+json Problem

Successful response headers:

Data
{
  "X-Request-Id": {
    "description": "Correlation id echoed on every response",
    "schema": {
      "type": "string"
    }
  },
  "RateLimit-Limit": {
    "description": "Per-key request limit for the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Remaining": {
    "description": "Requests remaining in the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Reset": {
    "description": "Seconds until the current window resets",
    "schema": {
      "type": "integer"
    }
  }
}

createConnection

POST /v1/connections

Deployment URL: https://ctx4.me/v1/connections. Replace parameters in braces with actual IDs from the API.

Initiate a connection (hosted auth link)

Capability: connections:write.

Parameters

NameLocationRequiredType and constraints
Idempotency-Keyheaderyes{"type":"string"} Client-chosen key (8-128 chars of [A-Za-z0-9._:-]); replays with the same payload return the original outcome

Request body

Required. CreateConnectionRequest

Data
{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/CreateConnectionRequest"
      }
    }
  }
}

Responses and errors

HTTPMeaningFormat and schema
201Hosted authorization link for the end userapplication/json HostedAuthLink
400Problem (validation_failed)application/problem+json Problem
401Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked)application/problem+json Problem
403Problem (capability_missing, forbidden)application/problem+json Problem
404Problem (not_found)application/problem+json Problem
409Problem (conflict)application/problem+json Problem
429Problem (rate_limited)application/problem+json Problem
500Problem (internal)application/problem+json Problem
503Problem (service_unavailable)application/problem+json Problem

Successful response headers:

Data
{
  "X-Request-Id": {
    "description": "Correlation id echoed on every response",
    "schema": {
      "type": "string"
    }
  },
  "RateLimit-Limit": {
    "description": "Per-key request limit for the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Remaining": {
    "description": "Requests remaining in the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Reset": {
    "description": "Seconds until the current window resets",
    "schema": {
      "type": "integer"
    }
  }
}

getConnection

GET /v1/connections/{connectionId}

Deployment URL: https://ctx4.me/v1/connections/{connectionId}. Replace parameters in braces with actual IDs from the API.

Get one connection

Capability: connections:read.

Parameters

NameLocationRequiredType and constraints
connectionIdpathyes{"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"}

Responses and errors

HTTPMeaningFormat and schema
200Connection view (engine-free)application/json Connection
400Problem (validation_failed)application/problem+json Problem
401Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked)application/problem+json Problem
403Problem (capability_missing)application/problem+json Problem
404Problem (not_found)application/problem+json Problem
429Problem (rate_limited)application/problem+json Problem
500Problem (internal)application/problem+json Problem
503Problem (service_unavailable)application/problem+json Problem

Successful response headers:

Data
{
  "X-Request-Id": {
    "description": "Correlation id echoed on every response",
    "schema": {
      "type": "string"
    }
  },
  "RateLimit-Limit": {
    "description": "Per-key request limit for the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Remaining": {
    "description": "Requests remaining in the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Reset": {
    "description": "Seconds until the current window resets",
    "schema": {
      "type": "integer"
    }
  }
}

listAuthConfigs

GET /v1/auth-configs

Deployment URL: https://ctx4.me/v1/auth-configs. Replace parameters in braces with actual IDs from the API.

List auth configurations

Capability: connections:read.

Parameters

NameLocationRequiredType and constraints
connector_idqueryno{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,78}$","example":"bitrix24"}
cursorqueryno{"type":"string","minLength":1,"maxLength":400,"pattern":"^[A-Za-z0-9_-]+$","description":"Opaque pagination cursor from a previous response"} Opaque pagination cursor from a previous response
limitqueryno{"type":"integer","minimum":1,"maximum":100,"description":"Page size (1-100, default 20)"} Page size (1-100, default 20)

Responses and errors

HTTPMeaningFormat and schema
200Auth configurations in the key's workspaceapplication/json AuthConfigListResponse
400Problem (validation_failed)application/problem+json Problem
401Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked)application/problem+json Problem
403Problem (capability_missing)application/problem+json Problem
429Problem (rate_limited)application/problem+json Problem
500Problem (internal)application/problem+json Problem
503Problem (service_unavailable)application/problem+json Problem

Successful response headers:

Data
{
  "X-Request-Id": {
    "description": "Correlation id echoed on every response",
    "schema": {
      "type": "string"
    }
  },
  "RateLimit-Limit": {
    "description": "Per-key request limit for the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Remaining": {
    "description": "Requests remaining in the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Reset": {
    "description": "Seconds until the current window resets",
    "schema": {
      "type": "integer"
    }
  }
}

createAuthConfig

POST /v1/auth-configs

Deployment URL: https://ctx4.me/v1/auth-configs. Replace parameters in braces with actual IDs from the API.

Create an auth configuration

Capability: connections:write.

The contract defines no additional parameters.

Request body

Required. CreateAuthConfigRequest

Data
{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/CreateAuthConfigRequest"
      }
    }
  }
}

Responses and errors

HTTPMeaningFormat and schema
201The created auth configurationapplication/json AuthConfig
400Problem (validation_failed)application/problem+json Problem
401Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked)application/problem+json Problem
403Problem (capability_missing, forbidden)application/problem+json Problem
409Problem (conflict)application/problem+json Problem
429Problem (rate_limited)application/problem+json Problem
500Problem (internal)application/problem+json Problem
503Problem (service_unavailable)application/problem+json Problem

Successful response headers:

Data
{
  "X-Request-Id": {
    "description": "Correlation id echoed on every response",
    "schema": {
      "type": "string"
    }
  },
  "RateLimit-Limit": {
    "description": "Per-key request limit for the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Remaining": {
    "description": "Requests remaining in the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Reset": {
    "description": "Seconds until the current window resets",
    "schema": {
      "type": "integer"
    }
  }
}

getAuthConfig

GET /v1/auth-configs/{authConfigId}

Deployment URL: https://ctx4.me/v1/auth-configs/{authConfigId}. Replace parameters in braces with actual IDs from the API.

Get one auth configuration

Capability: connections:read.

Parameters

NameLocationRequiredType and constraints
authConfigIdpathyes{"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"}

Responses and errors

HTTPMeaningFormat and schema
200Auth configuration (secret-free)application/json AuthConfig
400Problem (validation_failed)application/problem+json Problem
401Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked)application/problem+json Problem
403Problem (capability_missing)application/problem+json Problem
404Problem (not_found)application/problem+json Problem
429Problem (rate_limited)application/problem+json Problem
500Problem (internal)application/problem+json Problem
503Problem (service_unavailable)application/problem+json Problem

Successful response headers:

Data
{
  "X-Request-Id": {
    "description": "Correlation id echoed on every response",
    "schema": {
      "type": "string"
    }
  },
  "RateLimit-Limit": {
    "description": "Per-key request limit for the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Remaining": {
    "description": "Requests remaining in the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Reset": {
    "description": "Seconds until the current window resets",
    "schema": {
      "type": "integer"
    }
  }
}

updateAuthConfig

PATCH /v1/auth-configs/{authConfigId}

Deployment URL: https://ctx4.me/v1/auth-configs/{authConfigId}. Replace parameters in braces with actual IDs from the API.

Update an auth configuration

Capability: connections:write.

Parameters

NameLocationRequiredType and constraints
authConfigIdpathyes{"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"}

Request body

Required. UpdateAuthConfigRequest

Data
{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/UpdateAuthConfigRequest"
      }
    }
  }
}

Responses and errors

HTTPMeaningFormat and schema
200The updated auth configurationapplication/json AuthConfig
400Problem (validation_failed)application/problem+json Problem
401Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked)application/problem+json Problem
403Problem (capability_missing, forbidden)application/problem+json Problem
404Problem (not_found)application/problem+json Problem
409Problem (conflict)application/problem+json Problem
429Problem (rate_limited)application/problem+json Problem
500Problem (internal)application/problem+json Problem
503Problem (service_unavailable)application/problem+json Problem

Successful response headers:

Data
{
  "X-Request-Id": {
    "description": "Correlation id echoed on every response",
    "schema": {
      "type": "string"
    }
  },
  "RateLimit-Limit": {
    "description": "Per-key request limit for the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Remaining": {
    "description": "Requests remaining in the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Reset": {
    "description": "Seconds until the current window resets",
    "schema": {
      "type": "integer"
    }
  }
}

deleteAuthConfig

DELETE /v1/auth-configs/{authConfigId}

Deployment URL: https://ctx4.me/v1/auth-configs/{authConfigId}. Replace parameters in braces with actual IDs from the API.

Delete an auth configuration

Capability: connections:write.

Parameters

NameLocationRequiredType and constraints
authConfigIdpathyes{"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"}

Responses and errors

HTTPMeaningFormat and schema
204DeletedThe contract does not define a body
400Problem (validation_failed)application/problem+json Problem
401Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked)application/problem+json Problem
403Problem (capability_missing, forbidden)application/problem+json Problem
404Problem (not_found)application/problem+json Problem
409Problem (conflict)application/problem+json Problem
429Problem (rate_limited)application/problem+json Problem
500Problem (internal)application/problem+json Problem
503Problem (service_unavailable)application/problem+json Problem

Successful response headers:

Data
{
  "X-Request-Id": {
    "description": "Correlation id echoed on every response",
    "schema": {
      "type": "string"
    }
  },
  "RateLimit-Limit": {
    "description": "Per-key request limit for the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Remaining": {
    "description": "Requests remaining in the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Reset": {
    "description": "Seconds until the current window resets",
    "schema": {
      "type": "integer"
    }
  }
}

getProviderSchema

GET /v1/connections/{connectionId}/schemas/{entity}

Deployment URL: https://ctx4.me/v1/connections/{connectionId}/schemas/{entity}. Replace parameters in braces with actual IDs from the API.

Read the latest discovered provider entity schema

Capability: connections:read.

Parameters

NameLocationRequiredType and constraints
connectionIdpathyes{"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"}
entitypathyes{"type":"string","minLength":1,"maxLength":80}

Responses and errors

HTTPMeaningFormat and schema
200Latest tenant-scoped provider schemaapplication/json ProviderSchema
400Problem (validation_failed)application/problem+json Problem
401Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked)application/problem+json Problem
403Problem (capability_missing, forbidden)application/problem+json Problem
404Problem (not_found)application/problem+json Problem
429Problem (rate_limited)application/problem+json Problem
500Problem (internal)application/problem+json Problem
503Problem (service_unavailable)application/problem+json Problem

Successful response headers:

Data
{
  "X-Request-Id": {
    "description": "Correlation id echoed on every response",
    "schema": {
      "type": "string"
    }
  },
  "RateLimit-Limit": {
    "description": "Per-key request limit for the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Remaining": {
    "description": "Requests remaining in the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Reset": {
    "description": "Seconds until the current window resets",
    "schema": {
      "type": "integer"
    }
  }
}

discoverProviderSchema

POST /v1/connections/{connectionId}/schemas/{entity}

Deployment URL: https://ctx4.me/v1/connections/{connectionId}/schemas/{entity}. Replace parameters in braces with actual IDs from the API.

Discover and persist provider entity metadata

Capability: connections:write.

Parameters

NameLocationRequiredType and constraints
Idempotency-Keyheaderyes{"type":"string"} Client-chosen key (8-128 chars of [A-Za-z0-9._:-]); replays with the same payload return the original outcome
connectionIdpathyes{"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"}
entitypathyes{"type":"string","minLength":1,"maxLength":80}

Responses and errors

HTTPMeaningFormat and schema
200Immutable provider schema revisionapplication/json ProviderSchema
400Problem (validation_failed)application/problem+json Problem
401Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked)application/problem+json Problem
403Problem (capability_missing, forbidden)application/problem+json Problem
404Problem (not_found)application/problem+json Problem
429Problem (rate_limited)application/problem+json Problem
500Problem (internal)application/problem+json Problem
503Problem (service_unavailable)application/problem+json Problem

Successful response headers:

Data
{
  "X-Request-Id": {
    "description": "Correlation id echoed on every response",
    "schema": {
      "type": "string"
    }
  },
  "RateLimit-Limit": {
    "description": "Per-key request limit for the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Remaining": {
    "description": "Requests remaining in the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Reset": {
    "description": "Seconds until the current window resets",
    "schema": {
      "type": "integer"
    }
  }
}