openapi: 3.2.0 info: title: Relm CRM Deals API version: 0.17.1 summary: API-first CRM built for LLMs and AI agents. description: REST surface for Relm. contact: name: Relm url: https://relmcrm.com/ license: name: Proprietary servers: - url: https://api.relmcrm.com/v1 description: Production security: - bearerAuth: [] - oauth2: - crm tags: - name: Deals paths: /deals: get: tags: - Deals operationId: listDeals summary: List deals parameters: - $ref: '#/components/parameters/Limit' - $ref: '#/components/parameters/Cursor' - $ref: '#/components/parameters/IncludeDeleted' - name: q in: query schema: type: string - name: pipeline in: query schema: type: string description: 'Scope to ONE pipeline (key or pl_ id). Omit and you get deals from ALL pipelines merged - pass this whenever you reason about a single funnel, since stage keys are not unique across pipelines. Alias: pipeline_id.' - name: pipeline_id in: query schema: type: string - name: stage in: query schema: type: string - name: company_id in: query schema: type: string - name: primary_contact_id in: query schema: type: string responses: '200': description: Deal list content: application/json: schema: $ref: '#/components/schemas/DealList' default: $ref: '#/components/responses/Problem' post: tags: - Deals operationId: createDeal summary: Create a deal (title required) parameters: - $ref: '#/components/parameters/IdempotencyKey' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/DealInput' responses: '201': description: Created content: application/json: schema: $ref: '#/components/schemas/Deal' default: $ref: '#/components/responses/Problem' /deals/{id}: parameters: - $ref: '#/components/parameters/IdPath' get: tags: - Deals operationId: getDeal summary: Fetch a deal responses: '200': description: Deal content: application/json: schema: $ref: '#/components/schemas/Deal' default: $ref: '#/components/responses/Problem' patch: tags: - Deals operationId: updateDeal summary: Update a deal (incl. moving stage/pipeline) parameters: - $ref: '#/components/parameters/IfMatch' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/DealInput' responses: '200': description: Updated content: application/json: schema: $ref: '#/components/schemas/Deal' default: $ref: '#/components/responses/Problem' delete: tags: - Deals operationId: deleteDeal summary: Soft-delete a deal responses: '200': description: Deleted content: application/json: schema: $ref: '#/components/schemas/Deleted' default: $ref: '#/components/responses/Problem' /deals/{id}/restore: parameters: - $ref: '#/components/parameters/IdPath' post: tags: - Deals operationId: restoreDeal summary: Restore a deal responses: '200': description: Restored content: application/json: schema: $ref: '#/components/schemas/Deal' default: $ref: '#/components/responses/Problem' components: schemas: DealInput: type: object required: - title properties: title: type: string value_cents: type: integer currency: type: string pipeline: type: string description: Pipeline key or pl_ id (defaults to the default pipeline). stage: type: string description: Stage key within the deal's pipeline. company_id: type: string primary_contact_id: type: string close_date: type: string custom_fields: type: object Problem: type: object description: RFC-9457 error. Closed-set rejections carry valid_options + suggestion so an agent self-corrects. properties: type: type: string format: uri example: https://relmcrm.com/errors/unknown_value title: type: string status: type: integer detail: type: string code: type: string example: unknown_value field: type: string valid_options: type: array items: type: string suggestion: type: string request_id: type: string ListMeta: type: object properties: object: type: string const: list has_more: type: boolean next_cursor: type: - string - 'null' Deleted: type: object properties: id: type: string object: type: string deleted: type: boolean DealList: allOf: - $ref: '#/components/schemas/ListMeta' - type: object properties: data: type: array items: $ref: '#/components/schemas/Deal' Deal: type: object properties: id: type: string example: deal_... object: type: string const: deal title: type: string value_cents: type: - integer - 'null' description: Integer minor units (cents). currency: type: string pipeline: type: - string - 'null' description: Pipeline KEY. Every deal carries its pipeline - group/filter by (pipeline, stage), never by stage alone (stage keys are not unique across pipelines). pipeline_name: type: - string - 'null' description: Human display name of the pipeline. stage: type: - string - 'null' description: Stage KEY within this deal's pipeline. stage_label: type: - string - 'null' description: Human display label of the stage. stage_type: type: - string - 'null' enum: - open - won - lost - null description: Semantic stage type - use this for won/lost, cross-pipeline, instead of string-matching the key. company_id: type: - string - 'null' primary_contact_id: type: - string - 'null' close_date: type: - string - 'null' custom_fields: type: object version: type: integer mode: type: string created_at: type: string updated_at: type: string deleted: type: boolean responses: Problem: description: RFC-9457 problem+json error. content: application/problem+json: schema: $ref: '#/components/schemas/Problem' parameters: IfMatch: name: If-Match in: header schema: type: string description: The record's current version for optimistic concurrency; a mismatch returns 412 version_conflict. IdPath: name: id in: path required: true schema: type: string Cursor: name: cursor in: query schema: type: string description: Opaque keyset cursor from a prior next_cursor. IdempotencyKey: name: Idempotency-Key in: header schema: type: string description: 'Safely retry a create: same key + same body replays the original result.' Limit: name: limit in: query schema: type: integer default: 25 maximum: 100 description: Page size (default 25, max 100). IncludeDeleted: name: include_deleted in: query schema: type: boolean description: Include soft-deleted rows. securitySchemes: bearerAuth: type: http scheme: bearer description: Workspace-scoped API key. relm_live_... (live) or relm_test_... (free, isolated test mode). Mint at https://app.relmcrm.com/. oauth2: type: oauth2 description: 'OAuth 2.1 with PKCE (S256) and dynamic client registration (RFC 7591). Live mode only; test mode is API-key only. Discovery: /.well-known/oauth-authorization-server.' flows: authorizationCode: authorizationUrl: https://api.relmcrm.com/oauth/authorize tokenUrl: https://api.relmcrm.com/oauth/token refreshUrl: https://api.relmcrm.com/oauth/token scopes: crm: Read and write the connected Relm workspace