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/idAuthentication
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:
| Header | Type | Required | Description |
|---|---|---|---|
| x-api-key | string | Optional | Your Recoup API key. See Getting Started for how to create and manage keys. |
| Authorization | string | Optional | Bearer <access_token> from an authenticated session. Used internally only. |
Exactly one of
x-api-keyorAuthorizationmust 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
| Property | Type | Description |
|---|---|---|
| status | string | Status of the request ("success" or "error") |
| accountId | string | The unique identifier (UUID) of the authenticated account |
| message | string | Error message (present only when status is "error") |