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

# Organizations

> How API keys are scoped to organizations, and where to manage teams

## Overview

Organizations group connections, members and billing for a team or a client. On the API, organizations aren't managed through a public CRUD endpoint — instead, **your API key's scope determines which organization's data you see**, and every request is filtered automatically.

<Note>
  Creating organizations, inviting members and changing roles is done in the dashboard (or the internal app API), not the public `/v1` API. See [Managing members](/organizations/managing-members) and [Permissions](/organizations/permissions).
</Note>

## How Scoping Works

There are two kinds of keys (see [Authentication](/api-reference/authentication)):

<CardGroup cols={2}>
  <Card title="Personal key" icon="user">
    Sees your own connections **plus** connections in every organization you're a member of.
  </Card>

  <Card title="Organization key" icon="users">
    Bound to a single organization — only ever sees that organization's connections and data.
  </Card>
</CardGroup>

You never pass an organization ID to "switch" context. The key decides what's visible, so an organization key is the safest way to give a client, a CI job, or a per-tenant integration access to exactly one organization.

## Filtering by Organization

When a **personal** key can see multiple organizations, several endpoints accept an `organization_id` filter to narrow results to one of them:

```bash theme={null}
# All connections in a specific organization (personal key with access)
curl -H "Authorization: Bearer ops_your_api_key" \
  "https://api.opsmatic.com/v1/connections?organization_id=org_789"
```

The organization each connection belongs to is included in Connections API responses:

```json theme={null}
{
  "id": "conn_abc123",
  "service_name": "Production n8n",
  "organization_id": "org_789",
  "organizations": { "id": "org_789", "name": "Acme Agency" }
}
```

## Creating Connections in an Organization

When creating a connection, set `organization_id` to place it in an organization you belong to (omit it, or use `"personal"`, for a personal connection):

```bash theme={null}
curl -X POST https://api.opsmatic.com/v1/connections \
  -H "Authorization: Bearer ops_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "service_type": "n8n",
    "service_name": "Client Prod",
    "base_url": "https://n8n.client.com",
    "api_key": "n8n_api_key_here",
    "organization_id": "org_789"
  }'
```

You must have the `member`, `admin` or `owner` role in that organization, or the request returns `403`. An organization-scoped key can only ever create in its own organization.

## Managing Organizations & Members

<CardGroup cols={2}>
  <Card title="Creating organizations" icon="building" href="/organizations/creating-organizations">
    Set up a new organization for a team or client
  </Card>

  <Card title="Managing members" icon="user-plus" href="/organizations/managing-members">
    Invite, remove and re-role teammates
  </Card>

  <Card title="Permissions" icon="lock" href="/organizations/permissions">
    What each role can do
  </Card>

  <Card title="Authentication" icon="key" href="/api-reference/authentication">
    Personal vs. organization API keys
  </Card>
</CardGroup>
