canonical: https://jentic.com/apis/segmentapis.com/segmentapis

# Segment Public API

The Segment Public API allows you to manage Segment Workspaces and their resources including Sources, Destinations, Warehouses, Spaces, and more. The API exposes 30 endpoints secured with bearer authentication.

## For AI agents

Programmatically create source, list sources. Covers 30 operations with bearer authentication.

## Scope

Does not handle payments, communications, or crm - use for marketing only.

## Capabilities

- Create Source
- List Sources
- Get Source
- Update Source
- Delete Source
- Add Labels to Source
- Replace Labels in Source

## Use cases

### Marketing Operations

Use the Segment Public API to perform marketing operations programmatically. The API provides 30 endpoints covering core functionality including create source, list sources, get source.

Example prompt: Call POST /sources to create source

### Automated Sources Management

Automate sources operations by combining multiple Segment Public API endpoints. Agents can list sources and then get source in a single workflow.

Example prompt: Call GET /sources to list sources, then verify the result

### AI Agent Integration via Jentic

AI agents discover and call Segment Public API endpoints through Jentic without managing credentials directly. An agent searches for the required operation by intent, receives the matching endpoint schema, and executes the call with Jentic-managed authentication. This eliminates the need to read API documentation or handle bearer tokens manually.

Example prompt: Search Jentic for 'create source', load the operation schema, and execute with Jentic-managed credentials

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/sources` | Create Source |
| GET | `/sources` | List Sources |
| GET | `/sources/{sourceId}` | Get Source |
| PATCH | `/sources/{sourceId}` | Update Source |
| DELETE | `/sources/{sourceId}` | Delete Source |
| POST | `/sources/{sourceId}/labels` | Add Labels to Source |
| PUT | `/sources/{sourceId}/labels` | Replace Labels in Source |
| POST | `/sources/{sourceId}/write-keys` | Create Write Key for Source |

## Key resources

- **Sources** — Manage data collection sources
- **Destinations** — Manage data destinations
- **Warehouses** — Manage warehouse connections
- **Spaces** — Manage Segment spaces and messaging subscriptions

## AI readiness

This API is usable in Jentic One now. Its AI-readiness score against Jentic's framework shows where it stands today and where improvements would make it even easier for agents to use.

- **Score:** 66 / 100
- **Maturity:** AI-Aware
- **Dimensions:**
  - Foundational Compliance: 74 / 100
  - Developer Experience & Jentic Compatibility: 63 / 100
  - AI-Readiness & Agent Experience: 52 / 100
  - Agent Usability: 94 / 100
  - Security: 60 / 100
  - AI Discoverability: 70 / 100
- **View full report:** https://jentic.com/apis/segmentapis.com/segmentapis/scorecard
- **How the score is calculated:** https://docs.jentic.com/reference/api-readiness-framework/overview/
- **More about the dimensions:** https://docs.jentic.com/reference/api-readiness-framework/specification/#dimensional-model-overview

### Score it yourself

Every API in the directory is allowlisted, so you can re-score it with no key required.

- **Score your own API:** https://jentic.com/scorecard.md
- **Scoring CLI agent skill:** https://github.com/jentic/jentic-api-scorecard/blob/main/skills/jentic-api-scorecard/SKILL.md

```sh
npx @jentic/api-scorecard-cli score <openapi-url>
```

## Why Jentic

- **Setup:** Wiring the Segment Public API by hand means obtaining its bearer token, threading it onto every call, and building each source, label, and write-key request yourself. Through Jentic you install once, import Segment Public from the API Directory, store the token once, and your agent calls it.
- **Permission scoping:** The Segment Public API puts the source id in the URL path (`/sources/{sourceId}/...`), so a rule can pin your agent to one source: it can manage that source's labels and write keys and nothing else. You choose the operations it may call, so destructive ones like deleting a source are not included unless you add them.
- **Credential handling:** Your Segment Public API token is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'create a source' or 'add a source write key', and Jentic returns the matching Segment Public API operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Mailchimp** — Alternative marketing API
- **Hubspot** — Alternative marketing API

## FAQ

### What authentication does the Segment Public API use?

The Segment Public API uses a Bearer token in the Authorization header. Through Jentic, these credentials are stored encrypted in your Jentic One instance and injected at execution time, so raw secrets never enter the agent context.

### Can I create source with the Segment Public API?

Yes. Use the POST /sources endpoint. The API returns structured JSON responses that agents can parse and act on directly.

### What are the rate limits for the Segment Public API?

Rate limits are not specified in the OpenAPI spec. Check the vendor documentation for current limits. Through Jentic, rate limiting is handled automatically with retry logic built into the execution layer.

### How do I create source through Jentic?

Install the Jentic SDK with pip install jentic, authenticate through Jentic One, the self-hosted execution layer, then search for 'create source'. Jentic returns the matching Segment Public API operation with its input schema. Load the schema and execute the call - credentials are injected automatically.

### How many endpoints does the Segment Public API have?

The Segment Public API exposes 30 endpoints covering sources, destinations, warehouses operations.

### Can I limit what my agent is allowed to do with the Segment Public API?

Yes. Because you run Jentic One yourself, your own rules decide which Segment Public API operations and credentials the agent may use. Since the source id sits in the URL path (`/sources/{sourceId}/labels`, `/sources/{sourceId}/write-keys`), you can pin the agent to a single source so it manages only that source's labels and write keys. You also choose which operations it may call, so a destructive one like DELETE `/sources/{sourceId}` is excluded unless you add it.
