# Greip auth.md

You are an agent. This document explains how to authenticate with Greip APIs.

Greip does **not** support agent-delegated login to human user accounts. Do not attempt to obtain dashboard session cookies, user OAuth tokens, or credentials that impersonate a Greip customer. Use an API key provisioned by a human operator.

## Step 1: Discover

Fetch protected resource metadata:

```http
GET https://greip.io/.well-known/oauth-protected-resource
```

Then fetch authorization server metadata:

```http
GET https://greip.io/.well-known/oauth-authorization-server
```

The `agent_auth` block is published in both protected resource metadata and authorization server metadata. It points back to this document at `https://greip.io/auth.md`.

## Step 2: Pick a method

Greip supports one credential model for agents:

| Method | Supported | Notes |
| --- | --- | --- |
| API key (human provisioned) | Yes | Primary and only supported method |
| identity_assertion / ID-JAG | No | User delegation is not supported |
| service_auth (verified email ceremony) | No | Not supported |
| anonymous automated registration | No | Use human-provisioned API keys instead |

## Step 3: Obtain an API key

A human operator must create or access a Greip account and copy an API key for your integration.

1. Register or sign in at https://dashboard.greip.io/home
2. Open the API key section in the dashboard
3. Copy the API key and provide it to the agent runtime securely

Reference documentation:

- https://docs.greip.io/authentication
- https://docs.greip.io/knowledge-base/account-management/obtaining-api-key

Greip does not issue API keys through automated agent registration endpoints. Requests to `https://greip.io/agent/auth` return `422 api_key_provisioning_required`.

## Step 4: Call the API

Resource base URL: `https://v2.greipapi.com/`

Supported scopes: `api.read`

Send the API key in the `Authorization` header (API v2 does not accept `key` in the query string or body):

```bash
curl --request GET \
  --url 'https://v2.greipapi.com/geo/ip' \
  --header 'Authorization: Bearer <api-key>'
```

Whitelist the calling website or server in the Greip dashboard before production use.

## Errors

| Code | Endpoint | Meaning |
| --- | --- | --- |
| `api_key_provisioning_required` | `https://greip.io/agent/auth` | Use human-provisioned API keys instead |
| `claim_not_supported` | `https://greip.io/agent/auth/claim` | Claim ceremonies are not supported |
| `revocation_not_supported` | `https://greip.io/agent/auth/revoke` | Revoke keys in the Greip dashboard |
| `unsupported_grant_type` | `/oauth/token` | OAuth token exchange is not supported for API keys |

## Revocation

Revoke or rotate API keys in the Greip dashboard. Greip does not expose automated agent revocation for API keys.
