# API authentication and scopes

> Authenticate with the Fika Messaging API: create a workspace API credential, send it as a bearer token, and grant only the read and write scopes needed.

Source: https://fikamessaging.com/docs/developers/authentication-and-scopes

The API base URL is `https://api.fikamessaging.com`. Public API endpoints use the `/api/v1` prefix, so the versioned base URL is `https://api.fikamessaging.com/api/v1`. Create a credential in **Settings → API credentials** under Developer.

New and regenerated credentials start with `fika_live_`. Existing `notiva_live_` credentials remain valid until revoked or regenerated.

## Create and test a credential

1. Confirm the selected workspace and that workspace API access is enabled.
2. Select **Create credential** and name the integration.
3. Select its required scopes explicitly.
4. Create the credential and copy its secret when shown. Store it securely in your application's secret configuration.
5. Make a read request to verify access.

```bash
curl --fail-with-body   -H "Authorization: Bearer $FIKA_API_KEY"   -H "Accept: application/json"   'https://api.fikamessaging.com/api/v1/marketing-email/campaigns'
```

Set `FIKA_API_KEY` in your own environment first. This example requires `campaigns:read` and does not send email. Never put the key in browser code, a URL, or a public repository.

## Select scopes

| Resource | Read | Write | Additional grant |
| --- | --- | --- | --- |
| Contacts | `contacts:read` | `contacts:write` | — |
| Lists | `lists:read` | `lists:write` | — |
| Segments | `segments:read` | `segments:write` | — |
| Saved audiences | `audiences:read` | `audiences:write` | — |
| Campaigns | `campaigns:read` | `campaigns:write` | `campaigns:send` for launch, scheduling, and cancellation |
| Transactional emails (internal Centipid) | `transactional-emails:read` | — | `transactional-emails:send` for sending |
| Templates | `templates:read` | `templates:write` | — |
| Analytics | `analytics:read` | — | — |
| Conversations | `conversations:read` | `conversations:write` | `conversations:notes:read` for internal-note text |

Write grants imply read for their resource. Campaign write does not imply permission to send. Reading a conversation timeline does not grant internal-note text; that needs its separate scope.

## Understand credential ownership

Calls are attributed to the credential's creator. For Marketing Email API resources, scopes determine allowed API operations; they do not simply mirror every app-page permission held by that user.

A key stops authenticating when revoked, when workspace API access is disabled, or when its creator loses active membership or the required API-credential permission. Administrators can have management access across credentials; a developer's management actions can be limited to their own.

## Rotate, revoke, and investigate

**Regenerate** creates a new secret and invalidates the old key. Update the integration promptly. **Revoke** stops the credential from authenticating.

Inspect **API logs** for requests and failures, and **Developer → Activity** for credential changes. Every API response includes `X-Request-ID`; keep it with errors when requesting help.

See the [API reference](https://fikamessaging.com/docs/developers/api-reference) and [webhooks](https://fikamessaging.com/docs/developers/webhooks).
