For the complete documentation index, see llms.txt. This page is also available as Markdown.

post__apikeys

Create a new provider API key within a specific workspace.

Request

Endpoint: POST /apikeys

Creates a new API key entry associated with a specific workspace, allowing it to be reused when provisioning storage units or AI models. This endpoint requires a valid session token.

Request Body (CreateProviderApiKeyRequest)

Field
Type
Required
Description

workspaceId

string

Yes

The unique identifier of the workspace to link this API key to.

key

string

Yes

The public key, identifier, or email (depending on the provider).

secret

string

Yes

The private key or secret password. This is encrypted before saving.

provider

string

Yes

The provider type enum (e.g., AWS, GCP, AZURE).

endpoint

string | undefined

Optional

The custom endpoint URL (useful for S3-compatible endpoints).

region

string | undefined

Optional

The specific geographical region for the provider.

Request Example

curl -X POST "https://backend.flashback.tech/apikeys" \
  -H "Authorization: Bearer <your-session-token>" \
  -H "Content-Type: application/json" \
  -d '{
    "workspaceId": "workspace-uuid",
    "key": "YOUR_ACCESS_KEY",
    "secret": "YOUR_SECRET_KEY",
    "provider": "AWS",
    "endpoint": "s3.us-east-1.amazonaws.com",
    "region": "us-east-1"
  }'
const response = await fetch("https://backend.flashback.tech/apikeys", {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer <your-session-token>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    workspaceId: "workspace-uuid",
    key: "YOUR_ACCESS_KEY",
    secret: "YOUR_SECRET_KEY",
    provider: "AWS",
    endpoint: "s3.us-east-1.amazonaws.com",
    region: "us-east-1"
  })
});
const data = await response.json();
console.log(data);

Response

Response Fields (CreateProviderApiKeyResponse)

Field
Type
Description

success

boolean

Indicates whether the request was successful (true).

apiKeyId

string

The UUID of the newly created API key.

Response Example (201 Created)


Error Responses

400 Bad Request

Returned when required inputs are missing, or an identical API key already exists in this workspace.

401 Unauthorized

Returned when the session token is missing, invalid, or the user cannot be validated.

403 Forbidden

Returned when the user does not have permission to create API keys or write to buckets in the specified workspace.

500 Internal Server Error

Returned when an unexpected server error occurs.

Last updated

Was this helpful?