Skip to main content
POST
/
api-keys
Create an API key (admin, interactive session only)
curl --request POST \
  --url https://api.app.lastaccountingcompany.com/portal/api-keys \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>"
}
'
{
  "api_key": "<string>",
  "record": {
    "id": "<string>",
    "name": "<string>",
    "created_by": "<string>",
    "created_at": "<string>",
    "last_used_at": "<string>",
    "revoked_at": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Firebase ID token from an interactive portal session. Required for admin/approver-only operations (payroll approval, company settings, API-key management).

Body

application/json
name
string
required

Human-readable key name (max 120 characters).

Maximum string length: 120
scope
enum<string>
required

read keys are refused on all mutating methods; write keys act as the operator role.

Available options:
read,
write

Response

Key created. The secret is returned only in this response.

api_key
string

The bearer secret, lac_sk_.... Shown only once.

record
object

Portal API key metadata (never contains the secret).