Companies
Manage your tenant's organizational data, administrators, and API keys. These endpoints are designed for management dashboards rather than standard transaction flows.
Tenant Info
/v1/core/companies/meReturns the currently authenticated company profile based on the x-company-id header.
curl -X GET "https://api.switchlock.co.zw/v1/core/companies/me" \
-H "x-api-key: zl_sk_your_key_here" \
-H "x-company-id: cmp_01HXYZ..."{
"id": "cmp_01HXYZ...",
"name": "Acme Corp",
"slug": "acme-corp",
"system_fee_basis_points": 150,
"created_at": "2026-06-20T10:00:00.000Z"
}Administrators
Manage the personnel who have dashboard access to your tenant.
/v1/core/companies/adminsList all administrators for the company.
curl -X GET "https://api.switchlock.co.zw/v1/core/companies/admins" \
-H "x-api-key: zl_sk_your_key_here" \
-H "x-company-id: cmp_01HXYZ..."[
{
"id": "adm_01HXYZ...",
"firstName": "Jackson",
"lastName": "Doe",
"email": "admin@acme.co.zw",
"role": "OWNER",
"created_at": "2026-06-23T09:00:00.000Z"
}
]/v1/core/companies/adminsAdd a new administrator to your company.
| Field | Type | Required | Description |
|---|---|---|---|
| firstName | string | Yes | First name. |
| lastName | string | Yes | Last name. |
| string | Yes | Valid email address. | |
| role | enum | Yes | Role enum: admin or manager. |
| password | string | No | Defaults to Welcome123! if omitted. |
curl -X POST "https://api.switchlock.co.zw/v1/core/companies/admins" \
-H "x-api-key: zl_sk_your_key_here" \
-H "x-company-id: cmp_01HXYZ..." \
-H "Content-Type: application/json" \
-d '{
"firstName": "string",
"lastName": "string",
"email": "string",
"role": "string",
"password": "string"
}'/v1/core/companies/admins/:id/removeRemove an administrator from the company. The OWNER role cannot be removed.
| Field | Type | Required | Description |
|---|---|---|---|
| id | string (path) | Yes | UUID of the administrator. |
curl -X POST "https://api.switchlock.co.zw/v1/core/companies/admins/value/remove" \
-H "x-api-key: zl_sk_your_key_here" \
-H "x-company-id: cmp_01HXYZ..." \
-H "Content-Type: application/json" \
-d '{
"id": "string"
}'API Keys
For security, the raw zl_sk_... key is never returned by the list endpoint. Only the prefix and status are available.
/v1/core/companies/api-keysReturns metadata for all API keys associated with the company.
curl -X GET "https://api.switchlock.co.zw/v1/core/companies/api-keys" \
-H "x-api-key: zl_sk_your_key_here" \
-H "x-company-id: cmp_01HXYZ..."[
{
"id": "key_01HXYZ...",
"name": "Production Server",
"key_prefix": "a1b2c3d4",
"is_active": true,
"created_at": "2026-06-23T09:01:00.000Z"
}
]/v1/core/companies/api-keys/rollRolls a new API key. The raw secret key is only returned once in the response. Store it safely immediately.
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Display name for the new API key. |
curl -X POST "https://api.switchlock.co.zw/v1/core/companies/api-keys/roll" \
-H "x-api-key: zl_sk_your_key_here" \
-H "x-company-id: cmp_01HXYZ..." \
-H "Content-Type: application/json" \
-d '{
"name": "string"
}'{
"id": "key_01HXYZ...",
"key_prefix": "a1b2c3d4",
"secret_key": "zl_sk_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
"message": "Key generated. This secret will never be shown again."
}