# Door API

Door is DevBlanket's authentication and organization management service.

## Authentication

Use your Extra Key as a Bearer token:

```
Authorization: Bearer <your-extra-key>
```

## Key Endpoints

### Get Current User & Organization

```
GET /api/me
```

Returns the user and organization associated with your Extra Key:

```json
{
  "user": {
    "id": "abc123",
    "email": "user@example.com",
    "displayName": "User Name"
  },
  "organization": {
    "id": "org456",
    "name": "My Organization",
    "slug": "my-org"
  }
}
```

### List Organizations

```
GET /api/me/organizations
```

Returns all organizations the user belongs to.

### Get Organization Details

```
GET /api/orgs/:orgId
```

Returns organization details including subscription status.

### List Organization Members

```
GET /api/orgs/:orgId/members
```

Returns all members of an organization.

### Extra Keys

Manage Extra Keys (tokens like yours) for the organization:

```
GET /api/orgs/:orgId/extra-keys      # List your keys
POST /api/orgs/:orgId/extra-keys     # Create a new key
DELETE /api/orgs/:orgId/extra-keys/:keyId  # Delete a key
```

## OpenAPI Schema

Full API specification available at:

```
GET /openapi.json
```

## Error Format

```json
{
  "error": "Error message"
}
```

Common status codes:
- `401` - Invalid or missing authentication
- `403` - Access denied
- `404` - Resource not found
