# auth.md

Canonical URL: `https://apidojo.io/auth.md`

You are an agent. This is the registration guide for apidojo Actors. An Actor runs on Apify, and the credential that calls it is an Apify token. Read this file, then follow one method below. Do not invent a signup against this origin.

Audience: an agent calling `https://api.apify.com/v2/actors/apidojo~{actor}`. The documentation origin is `https://apidojo.io`. The authorization server issuer is `https://console-backend.apify.com`.

Apify's native registration preview at `https://apify.com/auth.md` is not executable. Do not call `https://api.apify.com/v2/agent/auth`. This service does not accept an ID-JAG (`urn:ietf:params:oauth:token-type:id-jag`).

## Discover

1. [Protected resource metadata](https://apidojo.io/.well-known/oauth-protected-resource)
2. [Authorization server metadata](https://apidojo.io/.well-known/oauth-authorization-server), including `agent_auth`

`authorization_servers` and `issuer` are both `https://console-backend.apify.com`. The scope is `full_api_access`. Send the credential as `Authorization: Bearer`.

## Pick a method

1. A person can sign in to Apify. Use OAuth or an API token. Identity type `identity_assertion`, assertion type `verified_email`. Credential type `access_token` or `api_key`.
2. Nobody can sign in, and you can pay. Buy a prepaid API token. Identity type `anonymous`. Credential type `api_key`. There is no claim step.
3. Stop if you only have an ID-JAG. It will not be accepted.

`verified_email` means the person signs in to an Apify account. Do not POST an email address or a JWT to `register_uri`.

## User present

### API token

Credential type `api_key`.

1. The person opens `https://console.apify.com/sign-up` if they have no account.
2. They copy a token from `https://console.apify.com/settings/integrations`.
3. You send `Authorization: Bearer <token>`.

### OAuth

Credential type `access_token`. This is the claim ceremony.

1. Register a client at `register_uri`, `https://console-backend.apify.com/oauth/apps`. That URL is Apify's dynamic client registration. It is the same URL as `registration_endpoint`. It does not accept an auth.md identity-assertion body.
2. Send the person to `claim_uri`, `https://console.apify.com/authorize/oauth`. They sign in and approve. Use PKCE `S256`. Scope `full_api_access`.
3. Exchange the code at `https://console-backend.apify.com/oauth/apps/token`.
4. Send `Authorization: Bearer <access_token>`.

The same issuer publishes `device_authorization_endpoint` at `https://console-backend.apify.com/oauth/apps/devices`. Use it only when your client already speaks the device-code grant. The person still approves in the browser.

If your client speaks MCP, connect to `https://mcp.apidojo.io`. The guide is `https://apidojo.io/mcp/`. Same issuer, same scope. The actors are the public actors on `https://apify.com/apidojo`. Their names are `https://mcp.apidojo.io/actors.json` and the server card at `https://apidojo.io/.well-known/mcp/server-card.json`.

## Anonymous

Credential type `api_key`. No `claim_uri`: a prepaid token is not attached to an Apify account afterwards.

1. Read `https://agi.apify.com/AGENTS.md`.
2. Buy a token at `https://agi.apify.com/protocols/x402/prepaid-tokens`. That URL is `agent_auth.anonymous.register_uri`. Pay with x402 or MPP. The minimum is $1.
3. Send the minted token as `Authorization: Bearer <token>`.

The temporary account expires (14 days on the AGI document). Unused balance is not refunded.

## Call an Actor

```http
POST https://api.apify.com/v2/actors/apidojo~{actor}/run-sync-get-dataset-items
Authorization: Bearer <credential>
Content-Type: application/json
```

Actor list: `https://apidojo.io/.well-known/api-catalog`. How to call a scraper: `https://apidojo.io/skill.md`.

A `401` means the credential is missing or no longer valid. Drop it and register again.

## Revocation

`revocation_uri` is `https://console.apify.com/settings/integrations`. The person deletes the API token or the OAuth app there. There is no endpoint that accepts a revocation POST from the agent, and there is no revocation event to deliver. A prepaid token is not revoked; it expires.
