---
title: "Create a new organization"
method: POST
path: "/v2/organizations"
tags: ["organizations"]
---

# Create a new organization

`POST /v2/organizations`

Create a new organization with environments and API keys.

## Request body

- RequestCreateOrganizationRequest
  - `envs` string[]
  - `org_name` string, required
  - `retention_hours` integer — Data retention period in hours (1-720). Defaults to 720 (1 month).

## Response `201`

Created

- ResponseCreateOrganizationResponse
  - `environments` ResponseEnvironmentWithKeyResponse[]
    - `api_key` string
    - `slug` string
  - `org_id` string

## Other responses

- `400` — Invalid request body or validation error
- `403` — Not allowed to create organizations
- `500` — Internal server error

## Changes

> 11 revisions in range; 1 could not be searched.

- **2026-03-16** `c32c822f1929` — 1 info
  - added the new optional request property `retention_hours`
- **2026-01-01** `aef6c851927f` — 1 warning
  - removed the request property `retention_hours`

[Change history](https://skmtc.dev/traceloop/apis/traceloop-api/changes/v2/organizations/post.md)

---

[API](https://skmtc.dev/traceloop/apis/traceloop-api.md) · [All operations](https://skmtc.dev/traceloop/apis/traceloop-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/traceloop/traceloop-api/revisions/9c12a04a5947/schema)
