# Choose and create credentials

Source: https://projectfeed.app/docs/api/service-accounts/overview

Choose between a workspace API key and a personal API token, then create a service account.

-   [Plan Free for read-only keys, Pro for write access](https://projectfeed.app/docs/billing)
-   Who Owners, admins, and members

## Workspace API key or personal API token

Project Feed has two kinds of API credentials. Both go in the same `Authorization: Bearer` header. A workspace API key is created in a workspace and works only there. It is called a service account in Workspace settings. A personal API token belongs to one person and can reach the workspaces its owner authorizes.

Free workspaces can create read-only API keys with read access to projects, posts, comments, reactions, and tasks. Pro workspaces create service accounts with write access and the rest of the scopes.

Use a workspace API key when

-   An automation, CI job, or third-party tool needs to act in one workspace.
-   Workspace owners should control the credential and its scopes.

Use something else when

-   A script or CLI command should act as you across workspaces. Use a personal API token from Account, then Tools & tokens. See [Personal API tokens](https://projectfeed.app/docs/account/api-tokens).
-   An outside system should create tasks, posts, or comments without an API key. Use an [inbound webhook](https://projectfeed.app/docs/api/inbound-webhooks).

A workspace API key acts as the member who created it. It stops working when that member leaves the workspace or their account is disabled. Members manage the keys they created. Owners and admins manage every key.

## Create a service account

1.  1.
    
    ### Open service account settings
    
    Go to Workspace settings, then Developers, open Service accounts, and select New service account. On a Free workspace the page is called Read-only API keys and the button is New API key. Owners, admins, and members can create keys when the Who can create API keys policy allows it. Viewers cannot.
    
2.  2.
    
    ### Name the key and set an expiration
    
    Enter a name that says what uses the key, such as CI deploy bot. Expiration offers 30, 60, 90, and 180 days, 1 year, or No expiration, and defaults to 90 days.
    
3.  3.
    
    ### Choose permissions
    
    Pick a preset or set each resource to None, Read, or, where it exists, Write. Write includes Read. Choose only what the job uses. A job that creates tasks in a known project needs `tasks:write`. Add `projects:read` if it also looks up projects. The Allowed API scopes policy limits the scopes a new or rotated key can request.
    
4.  4.
    
    ### Copy the secret
    
    Select Create service account, or Create API key on Free. Copy the secret into your secret manager. Project Feed cannot show it again, so keep it out of source control.
    

## Verify a new credential

Call the auth check endpoint to see the credential type, workspace, expiration, and effective scopes before you deploy the job.

Shell

```
curl https://projectfeed.app/api/v1/auth/check \
  -H "Authorization: Bearer pf_YOUR_API_KEY"
```

Then run one read against the resource the job will use. For a write key, create a disposable record and confirm it appears. To confirm the scopes are tight, try one request outside them and check that it returns 403.

## Fix creation problems

The secret was not saved

Rotate the key or create a new one. The secret cannot be shown again after the dialog closes.

New service account is missing

Your role or the Who can create API keys policy does not allow it. Ask an owner or admin.
