Skip to main content
An app key lets a caller without a browser session, such as a CI job or a script, call one app that handles requests. The key works only for that app and carries only scopes the app declares. Your code decides what each scope allows. An app key cannot open another app, act as a person, call the Marina API, or deploy code. To deploy from CI, use a workspace API key (mar_…) with MARINA_TOKEN or marina setup --token.

Declare scopes

Declare scopes in marina.json under access, then deploy. Each scope maps to a short description of what it allows. access requires an entrypoint.
marina.json

Create and manage keys

A workspace admin or the app’s creator manages its keys. Run these commands in the linked project directory, or pass --app <slug>:
Copy the key when it is created. Marina stores only a hash and cannot show it again; if it is lost, create a new key and revoke the old one. Store the key in your CI provider’s secret store, not in source control. A key can carry only scopes that the app’s live version declares. Key names are 1 to 60 characters. Keys without --expires-days last until revoked.

With the Marina API

The same operations are available with a workspace API key that has the publish permission. The user who created the API key must be a workspace admin or the app’s creator. {app} is the app’s slug or id.
The response’s key.token is the only copy of the key.

Call the app

Send the key as a bearer token to the app’s URL:
Marina removes the Authorization header before the request reaches your app. An Authorization value that does not begin with mak_ is not treated as an app key; the request follows the normal sign-in flow.

Check scopes in your app

Each request tells your app who is calling: Marina removes any x-platform-* header a caller sends, so your app can trust these values. Check the principal and the scope before doing the work:
An app key request has no signed-in user, so code that reads x-platform-user-id must handle its absence. Connection calls act for a signed-in person, so during an app key request they fail with Connection calls require an authenticated app request.

Scopes follow the live version

A key presents only the scopes that are both on the key and declared by the version it reaches. Removing a scope from marina.json and deploying, or rolling back to a version without it, removes that scope from every existing key. A key with no remaining scopes is refused.

Revocation and expiry

Revoking a key, its expiry, and scope changes take effect within 30 seconds.