Skip to content

Latest commit

 

History

History
269 lines (187 loc) · 5.77 KB

File metadata and controls

269 lines (187 loc) · 5.77 KB
title Create a customer
description Create a customer via Plane API. HTTP request format, parameters, scopes, and example responses for create a customer.
keywords plane, plane api, rest api, api integration, customer, create a customer

Create a customer

POST /api/v1/workspaces/{workspace_slug}/customers/

Create a new customer in the specified workspace.

Path Parameters

The workspace_slug represents the unique workspace identifier for a workspace in Plane. It can be found in the URL. For example, in the URL https://app.plane.so/my-team/projects/, the workspace slug is my-team.

Body Parameters

Name.

Description.

Description html.

Description stripped.

Email.

Website url.

Logo props.

Domain.

Employees.

Stage.

Contract status.

Revenue.

Archived at.

Created by.

Updated by.

Logo asset.

Scopes

customers:write

curl -X POST \
  "https://api.plane.so/api/v1/workspaces/my-workspace/customers/" \
  -H "X-API-Key: $PLANE_API_KEY" \
  # Or use -H "Authorization: Bearer $PLANE_OAUTH_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Example Name",
  "description": "example-value",
  "description_html": "<p>Example content</p>",
  "description_stripped": "Example description",
  "email": "Example Name",
  "website_url": "https://example.com/resource",
  "logo_props": "example-value",
  "domain": "Example Name",
  "employees": 1,
  "stage": "Example Name",
  "contract_status": "Example Name",
  "revenue": "Example Name",
  "archived_at": "2024-01-01T00:00:00Z",
  "created_by": "550e8400-e29b-41d4-a716-446655440000",
  "updated_by": "550e8400-e29b-41d4-a716-446655440000",
  "logo_asset": "550e8400-e29b-41d4-a716-446655440000"
}'
import requests

response = requests.post(
    "https://api.plane.so/api/v1/workspaces/my-workspace/customers/",
    headers={"X-API-Key": "your-api-key"},
    json={
      "name": "Example Name",
      "description": "example-value",
      "description_html": "<p>Example content</p>",
      "description_stripped": "Example description",
      "email": "Example Name",
      "website_url": "https://example.com/resource",
      "logo_props": "example-value",
      "domain": "Example Name",
      "employees": 1,
      "stage": "Example Name",
      "contract_status": "Example Name",
      "revenue": "Example Name",
      "archived_at": "2024-01-01T00:00:00Z",
      "created_by": "550e8400-e29b-41d4-a716-446655440000",
      "updated_by": "550e8400-e29b-41d4-a716-446655440000",
      "logo_asset": "550e8400-e29b-41d4-a716-446655440000"
    }
)
print(response.json())
const response = await fetch("https://api.plane.so/api/v1/workspaces/my-workspace/customers/", {
  method: "POST",
  headers: {
    "X-API-Key": "your-api-key",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    name: "Example Name",
    description: "example-value",
    description_html: "<p>Example content</p>",
    description_stripped: "Example description",
    email: "Example Name",
    website_url: "https://example.com/resource",
    logo_props: "example-value",
    domain: "Example Name",
    employees: 1,
    stage: "Example Name",
    contract_status: "Example Name",
    revenue: "Example Name",
    archived_at: "2024-01-01T00:00:00Z",
    created_by: "550e8400-e29b-41d4-a716-446655440000",
    updated_by: "550e8400-e29b-41d4-a716-446655440000",
    logo_asset: "550e8400-e29b-41d4-a716-446655440000",
  }),
});
const data = await response.json();
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "created_at": "2024-01-01T00:00:00Z",
  "updated_at": "2024-01-01T00:00:00Z",
  "name": "Example Name",
  "description": "example-value",
  "deleted_at": "2024-01-01T00:00:00Z",
  "customer_request_count": 1,
  "logo_url": "Example Name",
  "description_html": "<p>Example content</p>",
  "description_stripped": "Example description",
  "description_binary": "Example description",
  "email": "Example Name"
}