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

# Programmatic & Agentic Access

> Drive your whole organization from code with an admin API key, and let autonomous agents discover and pay for your agents through public discovery endpoints.

Everything you can do in the Organizations dashboard, you can do from code. The org-management surface is a REST API, so an autonomous agent or a back-office script can run **most** of your organization with no human in the loop. (A few flows still need a one-time browser step — card enrollment, for example.)

## Authenticate as the organization

Call the API with a [Nevermined API key](/docs/solutions/organizations/workspaces-and-members) that belongs to a member with the **Admin** role in the organization you want to act on. If the key is already scoped to a specific organization, that scope applies by default; to act on a different workspace, send the `X-Current-Org-Id` header — it **overrides** the key's own scope.

<Warning>
  An admin key can invite members, move treasury funds, and withdraw from organization wallets. Treat it like a production secret: keep it server-side and never hand it to an autonomous agent or a client you don't fully control.
</Warning>

<Tabs>
  <Tab title="cURL">
    ```bash theme={null}
    curl https://api.sandbox.nevermined.app/api/v1/organizations/my-memberships \
      -H "Authorization: Bearer $NVM_API_KEY" \
      -H "X-Current-Org-Id: org-9d81acea-7d38-460e-b7c0-c3b92abcbb07"
    ```
  </Tab>

  <Tab title="TypeScript">
    ```typescript theme={null}
    import { Payments } from '@nevermined-io/payments'

    const payments = Payments.getInstance({
      nvmApiKey: process.env.NVM_API_KEY!,
      environment: 'sandbox',
    })

    const memberships = await payments.organizations.getMyMemberships()
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    import os
    from payments_py import Payments

    payments = Payments(
      api_key=os.environ.get('NVM_API_KEY'),
      environment='sandbox',
    )

    memberships = payments.organizations.get_my_memberships()
    ```
  </Tab>
</Tabs>

See the [SDK & Workspaces](/docs/integrate/patterns/organizations) pattern for more on listing memberships and targeting a specific workspace when you publish agents or plans.

## What you can automate

Every organization feature is API-driven, subject to the same tier gates as the dashboard:

<CardGroup cols={2}>
  <Card title="Members & invitations" icon="users" href="/docs/solutions/organizations/workspaces-and-members">
    Invite, change roles, deactivate, and remove members.
  </Card>

  <Card title="Groups & budgets" icon="layer-group" href="/docs/solutions/organizations/groups-and-budgets">
    Create teams, cap their spend, and attach shared payment methods.
  </Card>

  <Card title="Organization wallets" icon="wallet" href="/docs/solutions/organizations/wallets">
    Create treasury wallets, check balances, fund groups, and withdraw.
  </Card>

  <Card title="Customers" icon="address-book" href="/docs/solutions/organizations/customers">
    Read your CRM and provision customers (Enterprise).
  </Card>

  <Card title="Analytics" icon="chart-line" href="/docs/solutions/organizations/analytics">
    Pull revenue, MRR, usage, and conversion metrics.
  </Card>

  <Card title="Events & webhooks" icon="bolt" href="/docs/solutions/organizations/activity-and-events">
    Read the activity feed and manage outbound webhooks.
  </Card>
</CardGroup>

<Note>
  The [White-label Onboarding](/docs/solutions/organizations/white-label-onboarding) flow is purpose-built for automation: one call provisions a **new** customer account under your brand and hands back a scoped key to pay for your agents on their behalf. (Onboarding an email that already has an account instead triggers a consent step before the accounts are linked.)
</Note>

## Let agents discover your organization

Beyond managing your own org, Nevermined exposes three **public, unauthenticated** endpoints per organization so that autonomous agents and discovery registries can find and pay for what you offer. They're served for active **Premium and Enterprise** organizations (any other org returns `404`).

| Endpoint                                                    | Format             | What it returns                                                                                                                                                                                    |
| ----------------------------------------------------------- | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `GET /api/v1/organizations/{orgId}/llms.txt`                | `text/plain`       | An `llms.txt` index of the organization's plans, agents, and Nevermined reference links.                                                                                                           |
| `GET /api/v1/organizations/{orgId}/agentic-instructions.md` | `text/markdown`    | Instructions telling an AI agent how to discover and pay for your plans and agents via Nevermined.                                                                                                 |
| `GET /api/v1/organizations/{orgId}/ai-catalog.json`         | `application/json` | Your **Agentic Resource Discovery (ARD)** catalog — one entry per listed agent, each carrying its x402 payment terms (plan, price, settlement network) in `metadata`. Crawlable by ARD registries. |

```bash theme={null}
# No auth needed — public discovery surface
curl https://api.sandbox.nevermined.app/api/v1/organizations/org-9d81acea-7d38-460e-b7c0-c3b92abcbb07/ai-catalog.json
```

<Tip>
  These endpoints are how an agent goes from "I found this organization" to "I can pay for its agents" without a human — the `ai-catalog.json` x402 terms are everything a paying agent needs. See [Buy & Call a Paid Agent](/docs/getting-started/ai-agent-purchase) for an end-to-end demo driven entirely by an `agentic-instructions.md` URL.
</Tip>

## Full API reference

Every operation is documented per-endpoint in the **Organizations** group of the **API** reference, auto-generated from the server's OpenAPI spec. For SDK-based access, see the [SDK & Workspaces](/docs/integrate/patterns/organizations) pattern.

## Related

<CardGroup cols={2}>
  <Card title="SDK & Workspaces" icon="code" href="/docs/integrate/patterns/organizations">
    List memberships, target a workspace, and read the activity feed from code.
  </Card>

  <Card title="White-label Onboarding" icon="user-plus" href="/docs/solutions/organizations/white-label-onboarding">
    Provision customers programmatically under your brand.
  </Card>
</CardGroup>


## Related topics

- [Organizations](/docs/solutions/organizations/overview.md)
- [Platform Partners](/docs/integrations/organizations.md)
- [Overview](/docs/getting-started/overview.md)
- [Agents Guide](/docs/agents-guide/overview.md)
- [Enroll a Card & Delegate a Budget](/docs/agents-guide/enroll-card.md)
