DEVELOPER DOCUMENTATION / API v1
Authentication
Handle Can You Just API credentials safely: Bearer authentication, worker mapping, scopes, overlapping rotation and revocation.
Authenticate the client
An API client is the software identity authenticated by a Bearer credential. Send Authorization: Bearer <credential> on every protected API operation. Use HTTPS outside Development. Browser cookies do not replace the API’s Bearer authentication.
Authorization: Bearer EXAMPLE_TOKEN_NOT_VALID
Identity and worker mapping
A client belongs to one organisation and has client-level scopes shared by its credentials. A client may map to an active worker resource. That resource must be assigned to a task for task ownership; a scope alone never grants ownership. GET /api/v1/identity reports the client, organisation, nullable resource and scopes.
An unmapped client returns resource: null. It can inspect identity and receives empty owned-work lists, but cannot operate on a task. Removing/changing a mapping changes current access immediately. Resource identity and human login identity are separate concepts.
Credential lifecycle
- An administrator configures a client and grants only needed scopes.
- The administrator issues a credential; its secret is displayed once.
- For rotation, issue a replacement while the old credential remains usable. Move the worker to the replacement and verify it.
- Explicitly revoke the old credential. Revoking a client invalidates its credentials together.
Credentials currently have no automatic expiry. Administrator-managed rotation and explicit revocation are the lifecycle policy. A credential also depends on an active organisation, active sponsoring user and active non-viewer sponsoring membership. A mapped resource must remain an active agent. A viewer sponsor, deactivated sponsor/user/organisation/resource or revoked client/credential causes authentication failure.
Handle credentials as secrets
- Use server-side/agent secret storage and restrict access to the worker process.
- Never commit credentials, embed them in browser bundles or put them in URLs.
- Redact Authorization headers in application, proxy and diagnostic logs.
- Rotate and revoke if exposure is suspected.
- Do not assume a new credential gives its client a fresh independent rate quota.
General browser CORS is not enabled. Build server-side integrations; do not store API credentials in browser storage. There is no public token creation or worker OAuth grant in this API.
When access fails
A 401 authentication_failed requires fixing the credential or its current lifecycle state. A 403 normally means a valid client lacks a scope or current task assignment. Do not retry a permission denial as a transient outage. Read error recovery and write preconditions.
Administrative external identity mappings
The organisation resource directory uses the same Bearer authentication and requires the separate organisation-resources:read scope. Administrators explicitly grant it on an existing client without rotating credentials or changing other scopes. Worker scopes do not imply directory access. The credential determines the organisation; callers cannot choose another organisation. CYJ neither creates nor stores external identity mappings: external systems store administrator-managed mappings keyed by immutable numeric CYJ resource ID. No automatic name matching or self-service account linking occurs.
Organisation isolation
Only platform administrators create organisations. Organisation administrators provision users, resources and clients in their own workspace. Every credential is permanently associated with its client's organisation. Browser organisation selection does not affect API credentials. Caller-supplied organisation IDs never grant access; foreign projects, tasks, calendars, resources, assignments and dependencies are rejected. Inactive organisations cannot authenticate clients or start work. Existing PlotDirector credentials retain their hashes and permissions.
Separate OAuth MCP connections can be configured for each organisation with a unique registered client, exact callback, administrator sponsor and Integration client. Consent and tokens are bound to that configured organisation; no public client or organisation registration is available.