> ## Documentation Index
> Fetch the complete documentation index at: https://docs.buildpixel.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Organizations

> Org settings, integrations, members.

## `GET /auth/me`

Returns the authenticated user's identity, current org, and membership.

```bash theme={null}
curl https://api.buildpixel.io/auth/me \
  -H "Authorization: Bearer $TOKEN"
```

Response:

```json theme={null}
{
  "user": { "id": "...", "email": "...", "name": "..." },
  "organization": {
    "id": "...",
    "name": "MyStudio",
    "slug": "mystudio",
    "plan": "pro"
  },
  "membership": { "role": "admin" }
}
```

## `PATCH /organizations/:id`

Update org settings.

```bash theme={null}
curl -X PATCH https://api.buildpixel.io/organizations/$ORG_ID \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "name": "MyStudio" }'
```

Editable fields include `name`, default project settings, and integration settings.

## `DELETE /organizations/:id/integrations/github`

Disconnect the GitHub App integration. Existing GitHub-backed projects fail builds until reconnected.

## `PATCH /organizations/:id/perforce`

Configure or update Perforce server credentials.

```bash theme={null}
curl -X PATCH https://api.buildpixel.io/organizations/$ORG_ID/perforce \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "serverUrl": "ssl:perforce.studio.com:1666",
    "userName": "bp-buildbot",
    "ticket": "<long-ticket-string>"
  }'
```

The endpoint runs `p4 info` to validate before persisting. Returns 400 if creds are wrong.
