Skip to main content
Browse documentation

Guide

API keys

Create project credentials with only the scopes your server integration needs.

On this page
  1. Prerequisites
  2. Create a key
  3. Expected result
  4. Errors
  5. Next step

Prerequisites

You need an active Moira Connect workspace, a selected project, and the Developer, Admin, or Owner role. Decide whether the credential is for test or production before creating it; the environment is encoded in the key prefix.

Create a key

Open API Keys, choose a descriptive name, select the minimum scopes, and set an expiry when the workload allows rotation. The plaintext value appears once.

bash
export MOIRA_API_KEY="paste-the-one-time-value"
curl https://api.moiraconnect.com/v1/accounts \
  -H "Authorization: Bearer $MOIRA_API_KEY"

Never commit the value, include it in a client bundle, or send it in a query string. Existing keys show only their prefix, scope set, expiry, and last-use metadata.

Expected result

The request returns accounts from the key's project only. A project credential cannot list or infer resources from another project, even within the same workspace.

Errors

  • 401 unauthorized means the key is missing, malformed, revoked, expired, or unknown.
  • 403 forbidden means the key lacks the required scope.
  • 429 rate_limit_exceeded includes the current project limit and reset time.

Next step

Create a hosted connection, then subscribe to webhooks or realtime events before sending customer messages.