openapi: 3.0.3 info: title: Custom Sources API description: 'Manage custom sources in the Demandbase platform. Custom sources let you define named data origins and configure field mappings for the data they provide. ' version: '1.0' servers: - url: https://uapi.demandbase.demandbase.com security: - bearerAuth: [] tags: - name: Custom Sources description: Create and manage custom sources. - name: Field Mappings description: Configure field mappings for a source and object type. paths: /integration/v1/custom-sources: get: summary: List custom sources description: Returns a paginated list of sources, optionally filtered by source group. tags: - Custom Sources parameters: - name: group in: query required: false schema: type: string enum: - custom - standard - all description: Filter sources by source group. - name: perPage in: query required: false schema: type: integer format: int32 description: Number of items per page. - name: page in: query required: false schema: type: integer format: int32 description: Page number (1-indexed). responses: '200': description: A paginated list of sources. content: application/json: schema: $ref: '#/components/schemas/GetSourcesResponse' examples: Example: value: totalCount: 2 data: - id: 1 name: Salesforce CRM description: Accounts imported from Salesforce. sourceGroup: custom priority: 50 - id: 2 name: HubSpot description: Contacts from HubSpot. sourceGroup: custom priority: 51 '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '500': $ref: '#/components/responses/InternalServerError' post: summary: Create a custom source description: Creates a new custom source and returns the created resource. tags: - Custom Sources requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateSourceRequest' examples: Example: value: name: Salesforce CRM description: Accounts imported from Salesforce. priority: 50 responses: '201': description: The newly created source. content: application/json: schema: $ref: '#/components/schemas/SourceItem' examples: Example: value: id: 42 name: Salesforce CRM description: Accounts imported from Salesforce. sourceGroup: custom priority: 50 '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '500': $ref: '#/components/responses/InternalServerError' /integration/v1/custom-sources/{id}: get: summary: Get a custom source description: Returns a single source by its ID. tags: - Custom Sources parameters: - $ref: '#/components/parameters/SourceId' responses: '200': description: The requested source. content: application/json: schema: $ref: '#/components/schemas/SourceItem' examples: Example: value: id: 42 name: Salesforce CRM description: Accounts imported from Salesforce. sourceGroup: custom priority: 50 '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/InternalServerError' put: summary: Update a custom source description: Updates an existing source by its ID and returns the updated resource. tags: - Custom Sources parameters: - $ref: '#/components/parameters/SourceId' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpdateSourceRequest' examples: Example: value: name: Salesforce CRM (updated) description: Updated description. priority: 55 responses: '200': description: The updated source. content: application/json: schema: $ref: '#/components/schemas/SourceItem' examples: Example: value: id: 42 name: Salesforce CRM (updated) description: Updated description. sourceGroup: custom priority: 55 '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/InternalServerError' delete: summary: Delete a custom source description: Deletes an existing source by its ID. tags: - Custom Sources parameters: - $ref: '#/components/parameters/SourceId' responses: '204': description: Source deleted successfully. No content returned. '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/InternalServerError' /integration/v1/custom-sources/{source_id}/field-mappings/{object_type}: get: summary: Get field mappings description: Returns the field mappings configured for the given source and object type. tags: - Field Mappings parameters: - $ref: '#/components/parameters/SourceIdForMappings' - $ref: '#/components/parameters/ObjectType' responses: '200': description: Field mappings for the specified source and object type. content: application/json: schema: $ref: '#/components/schemas/FieldMappingsResponse' examples: Example: value: fieldMappings: - sourceFieldLabel: annual_revenue demandbaseFieldName: annualRevenue dataType: number - sourceFieldLabel: hq_country demandbaseFieldName: country dataType: string '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/InternalServerError' put: summary: Upsert field mappings description: 'Creates or replaces the field mappings for the given source and object type. The full set of mappings provided in the request body replaces any existing mappings. ' tags: - Field Mappings parameters: - $ref: '#/components/parameters/SourceIdForMappings' - $ref: '#/components/parameters/ObjectType' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/FieldMappingRequest' examples: Example: value: fieldMappings: - sourceFieldLabel: annual_revenue demandbaseFieldName: annualRevenue dataType: number - sourceFieldLabel: hq_country demandbaseFieldName: country dataType: string responses: '201': description: Field mappings upserted successfully. No content returned. '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/InternalServerError' components: securitySchemes: bearerAuth: type: http scheme: bearer description: 'Pass a header like: `Authorization: Bearer ` Visit [My Profile -> API Token](https://web.demandbase.com/o/ad/at) to generate an API token. ' parameters: SourceId: name: id in: path required: true schema: type: integer format: int64 description: The unique ID of the source. SourceIdForMappings: name: source_id in: path required: true schema: type: integer format: int64 description: The unique ID of the source. ObjectType: name: object_type in: path required: true schema: type: string enum: - account - person description: The object type for which field mappings are configured. responses: BadRequest: description: The request body or query parameters are invalid. content: application/json: schema: $ref: '#/components/schemas/StructuredError' examples: Example: value: error: code: 400-000 message: Invalid input. diagnosticCode: a1b2c3d4-e5f6-7890-abcd-ef1234567890 Unauthorized: description: Authentication credentials are missing or invalid. content: application/json: schema: $ref: '#/components/schemas/StructuredError' examples: Example: value: error: code: 403-000 message: Unauthorized. diagnosticCode: a1b2c3d4-e5f6-7890-abcd-ef1234567890 NotFound: description: The requested resource was not found. content: application/json: schema: $ref: '#/components/schemas/StructuredError' examples: Example: value: error: code: 404-000 message: Resource not found. diagnosticCode: a1b2c3d4-e5f6-7890-abcd-ef1234567890 InternalServerError: description: An unexpected server error occurred. content: application/json: schema: $ref: '#/components/schemas/StructuredError' examples: Example: value: error: code: 500-001 message: Internal server error. diagnosticCode: a1b2c3d4-e5f6-7890-abcd-ef1234567890 schemas: SourceItem: type: object required: - id - name - description - priority properties: id: type: integer format: int64 description: Unique identifier of the source. name: type: string description: Human-readable name of the source. description: type: string description: Description of the source. sourceGroup: type: string description: The group this source belongs to (e.g. `custom`, `standard`). priority: type: integer description: 'Priority for source ordering. 0 = no preference; 50-99 = custom sources (lower number = higher priority). ' GetSourcesResponse: type: object required: - totalCount - data properties: totalCount: type: integer format: int64 description: Total number of sources matching the query. data: type: array items: $ref: '#/components/schemas/SourceItem' CreateSourceRequest: type: object required: - name - description - priority properties: name: type: string description: Human-readable name of the source. description: type: string description: Description of the source. priority: type: integer description: 'Priority for source ordering. Valid values: 0 (no preference) or 50-99 (custom) inclusive. ' UpdateSourceRequest: type: object required: - name - description - priority properties: name: type: string description: Human-readable name of the source. description: type: string description: Description of the source. priority: type: integer description: 'Priority for source ordering. Valid values: 0 (no preference) or 50-99 (custom) inclusive. ' FieldMappingDTO: type: object required: - sourceFieldLabel - demandbaseFieldName - dataType properties: sourceFieldLabel: type: string description: Label/name of the field as provided by the external source. demandbaseFieldName: type: string description: Canonical Demandbase field name the source field is mapped to. dataType: type: string description: 'Data type of the mapped field (for example: string, number, boolean, date).' FieldMappingsResponse: type: object required: - fieldMappings properties: fieldMappings: type: array items: $ref: '#/components/schemas/FieldMappingDTO' description: List of field mappings configured for the requested source/object type. FieldMappingRequest: type: object required: - fieldMappings properties: fieldMappings: type: array items: $ref: '#/components/schemas/FieldMappingDTO' description: Field mappings to create/update for the given object type. StructuredError: type: object required: - error properties: error: type: object required: - code - message - diagnosticCode properties: code: type: string description: 'Machine-readable error code (e.g. `400-000`, `404-000`, `500-001`). Default values by HTTP status: 400 → `400-000`, 404 → `404-000`, 500 → `500-001`. ' message: type: string description: Human-readable description of the error. diagnosticCode: type: string description: UUID for tracing the request in server logs.