Skip to content

Get Account ID

Retrieve the ID of the authenticated account associated with the provided credentials. This is useful when you have an API key or access token but do not yet know the corresponding accountId.

Endpoint

GET https://recoup-api.vercel.app/api/accounts/id

Authentication

This endpoint uses headers only for input. It does not accept any query parameters or request body.

You can authenticate in one of two ways:

HeaderTypeRequiredDescription
x-api-keystringOptionalYour Recoup API key. See Getting Started for how to create and manage keys.
AuthorizationstringOptionalBearer <access_token> from an authenticated session. Used internally only.

Exactly one of x-api-key or Authorization must be provided for the request to succeed.

Request Examples

cURL
curl -X GET "https://recoup-api.vercel.app/api/accounts/id" \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY"

Response Format

{
  "status": "success",
  "accountId": "123e4567-e89b-12d3-a456-426614174000"
}
{
  "status": "error",
  "message": "Unauthorized"
}

Response Properties

PropertyTypeDescription
statusstringStatus of the request ("success" or "error")
accountIdstringThe unique identifier (UUID) of the authenticated account
messagestringError message (present only when status is "error")