Create an environment scoped API credential
Request and response reference for POST /v1/credentials.
/v1/credentialsRequest
Keep API keys in your backend. Required entitlements and institution scope still apply.
curl -X POST "$OSAI_API_BASE_URL/v1/credentials" \
-H "Authorization: ApiKey $OSAI_PUBLIC_ID:$OSAI_API_SECRET" \
-H "Content-Type: application/json" \
--data '{
"label": "<application-label>",
"environment": "<credential-scope>"
}'Parameters
| Name | Location | Requirement | Description |
|---|---|---|---|
Authorization | header · string | Required | Use the value defined for this resource. |
X-Request-Id | header · string | Optional | Use the value defined for this resource. |
Request body
Send JSON with Content-Type: application/json. Nested field names identify their parent object; required markers apply within that object. Replace template values using the relevant resource and configured instrument rules.
| Field | Type | Description & constraints |
|---|---|---|
labelRequired in parent object | string | Defined by the resource contract. |
environmentOptional | string | Defined by the resource contract. |
Responses
Inspect HTTP status before parsing a body. These tables describe client response fields rather than invented successful transaction payloads.
201 · Credential created; the secret is returned once
| Field | Type | Description & constraints |
|---|---|---|
public_idRequired in parent object | string | Defined by the resource contract. |
labelRequired in parent object | string | Defined by the resource contract. |
environmentRequired in parent object | string | Defined by the resource contract. |
statusRequired in parent object | string | Defined by the resource contract.Values: ACTIVE, REVOKED, EXPIRED |
created_atRequired in parent object | stringdate-time | Defined by the resource contract. |
secretRequired in parent object | string | Returned only during creation or rotation; store it securely. |
rotated_atOptional | stringdate-time | Present for rotation responses. |
request_idRequired in parent object | string | Defined by the resource contract. |
403 · Credential creation is not entitled
No client body fields are defined for this response.
503 · Customer service unavailable
No client body fields are defined for this response.
Retries & recovery
Keep the original request identifiers and any required idempotency key. A timeout does not establish failure. Read the original resource or command before another financial write; use expected versions for concurrent changes.