openapi: 3.2.0 info: title: DoiT Annotations API description: Programmatic access to DoiT Platform version: v1 servers: - url: https://api.doit.com security: - api_key: [] - tenantId: [] api_key: [] tags: - name: Annotations description: Custom notes added to cost data to provide contextual information. paths: /analytics/v1/annotations: get: tags: - Annotations summary: List annotations description: 'Returns a list of annotations that your account has access to. Annotations are listed in reverse chronological order by default.' operationId: listAnnotations parameters: - $ref: '#/components/parameters/maxResults' - $ref: '#/components/parameters/pageToken' - name: filter in: query description: 'An expression for filtering the results. Valid fields: **content**, **timestamp**, **labels**.' example: content:budget schema: type: string - name: sortBy in: query description: A field by which the results will be sorted. schema: type: string enum: - id - content - timestamp - timeCreated - timeModified - $ref: '#/components/parameters/sortOrder' responses: '200': description: OK - The request succeeded. content: application/json: schema: type: object properties: pageToken: type: string description: Page token, returned by a previous call, to request the next page of results rowCount: type: integer description: Total number of annotations in the result set annotations: type: array items: $ref: '#/components/schemas/AnnotationListItem' '400': $ref: '#/components/responses/400' '401': $ref: '#/components/responses/401' '403': $ref: '#/components/responses/403' '404': $ref: '#/components/responses/404' post: tags: - Annotations summary: Create an annotation description: Creates a new annotation. operationId: createAnnotation requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateAnnotationRequest' required: true responses: '201': description: Created - Annotation created successfully. content: application/json: schema: $ref: '#/components/schemas/AnnotationListItem' links: getAnnotation: operationId: getAnnotation parameters: id: $response.body#/id updateAnnotation: operationId: updateAnnotation parameters: id: $response.body#/id deleteAnnotation: operationId: deleteAnnotation parameters: id: $response.body#/id '400': $ref: '#/components/responses/400' '401': $ref: '#/components/responses/401' '403': $ref: '#/components/responses/403' '404': $ref: '#/components/responses/404' x-codegen-request-body-name: Body /analytics/v1/annotations/{id}: get: tags: - Annotations summary: Retrieve an annotation description: Returns an annotation by the specified Id. operationId: getAnnotation parameters: - name: id in: path description: Annotation ID required: true schema: type: string responses: '200': description: OK - Annotation returned. content: application/json: schema: $ref: '#/components/schemas/AnnotationListItem' links: updateAnnotation: operationId: updateAnnotation parameters: id: $request.path.id deleteAnnotation: operationId: deleteAnnotation parameters: id: $request.path.id '400': $ref: '#/components/responses/400' '401': $ref: '#/components/responses/401' '403': $ref: '#/components/responses/403' '404': $ref: '#/components/responses/404' delete: tags: - Annotations summary: Delete an annotation description: Deletes the annotation specified by the Id. operationId: deleteAnnotation parameters: - name: id in: path description: Annotation ID required: true schema: type: string responses: '200': description: OK - Annotation deleted. content: application/json: schema: type: object additionalProperties: false example: {} '400': $ref: '#/components/responses/400' '401': $ref: '#/components/responses/401' '403': $ref: '#/components/responses/403' '404': $ref: '#/components/responses/404' patch: tags: - Annotations summary: Update an annotation description: Updates the annotation specified by the Id. operationId: updateAnnotation parameters: - name: id in: path description: Annotation ID required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/UpdateAnnotationRequest' example: content: Updated annotation content responses: '200': description: OK - Annotation updated. content: application/json: schema: $ref: '#/components/schemas/AnnotationListItem' '400': $ref: '#/components/responses/400' '401': $ref: '#/components/responses/401' '403': $ref: '#/components/responses/403' '404': $ref: '#/components/responses/404' x-codegen-request-body-name: Body components: responses: '400': description: Bad Request - The server cannot process the request, often due to a malformed request. content: application/json: schema: $ref: '#/components/schemas/Error' '401': description: Unauthorized - Invalid API key. content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Not Found - The requested resource does not exist. content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: Forbidden - The client is not authorized to perform the request. content: application/json: schema: $ref: '#/components/schemas/Error' parameters: pageToken: name: pageToken in: query description: Page token, returned by a previous call, to request the next page of results schema: type: string maxResults: name: maxResults in: query description: The maximum number of results to return in a single page. Use the page tokens to iterate through the entire collection. schema: type: integer format: int64 default: 50 sortOrder: name: sortOrder in: query description: Sort order can be ascending or descending. schema: type: string enum: - asc - desc schemas: UpdateAnnotationRequest: type: object description: Request body for updating an annotation. properties: content: type: - string - 'null' description: The content of the annotation. timestamp: type: - string - 'null' format: date-time description: The date associated with the annotation. reports: type: - array - 'null' items: type: string description: List of report IDs associated with the annotation. labels: type: - array - 'null' items: type: string description: List of label IDs to associate with the annotation. Labels must already exist. Error: type: object description: Standard error response structure. properties: error: type: string description: Detailed error message. CreateAnnotationRequest: required: - content - timestamp type: object description: Request body to create an annotation. properties: content: type: string description: The content of the annotation. timestamp: type: string format: date-time description: The date associated with the annotation. reports: type: array items: type: string description: List of report IDs associated with the annotation. labels: type: array items: type: string description: List of label IDs to associate with the annotation. Labels must already exist. AnnotationListItem: required: - id - content - timestamp type: object description: Summary information about an annotation. properties: id: type: string description: The unique identifier of the annotation. content: type: string description: The content of the annotation. timestamp: type: string format: date-time description: The date associated with the annotation. reports: type: array items: type: string description: List of report IDs associated with the annotation. labels: type: array items: $ref: '#/components/schemas/LabelInfo' description: List of labels associated with the annotation. createTime: type: string format: date-time description: The creation time of the annotation. updateTime: type: string format: date-time description: The time when the annotation was last updated. LabelInfo: required: - id - name type: object description: Metadata for a label. properties: id: type: string description: The unique identifier of the label. name: type: string description: The name of the label. securitySchemes: api_key: type: apiKey name: Authorization description: Use the "Bearer " format or sign in for autofill in: header tenantId: type: apiKey name: X-Tenant-Id description: 'Tenant (customer) ID that sets the request''s customer context. Required when the credential can access more than one tenant; omit when the credential is scoped to exactly one tenant (the server resolves that tenant automatically). If omitted for a multi-tenant credential, the request fails with `400` and code `tenant_id_required`. If the value conflicts with the credential''s tenant scope, the request fails with `400` and code `tenant_id_mismatch`. Use this header over the legacy `customerContext` query parameter, which only applies to legacy API keys and is ignored by personal and service-account API tokens. ' in: header oauth2: type: oauth2 flows: authorizationCode: authorizationUrl: https://console.doit.com/sign-in/oauth tokenUrl: https://console.doit.com/api/auth/token scopes: dci: Access All Data x-samples-languages: - curl - go - node - python x-cli-config: security: oauth2 params: client_id: cli