1Factory QMS API

Data related to Quality

OpenAPI Specification

1factory-qms-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: 1Factory Customers QMS API
  description: "This API allows you to create and query a number of objects in your 1Factory account.\n\n The API accepts and returns request and response bodies as JSON, using UTF-8 encoding.\n\nClients may request that response bodies are compressed using gzip compression by passing 'gzip' in the 'Accept-Encoding' header.\n\nIn order to use the API, you need to generate an API key for your organization in the API section of the Settings page.\n\nEach API request must include the API key and your organization's ID as header parameters. You can also find your organization ID in the Settings page.\n\nAll date time values used in the API are in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date-time format, and include a timezone offset value. Incoming values can specify any timezone offset.\n\nErrors returned by the API include an error code. An explanation of these error codes is available [here](./errors.html).\n\nUsage of the API is rate-limited - current default limits are:\n- 60 requests per minute\n- 1000 requests per day\n\nExceeding these limits will result in subsequent API requests returning a 429 error code. The daily request limit resets at midnight UTC.\n\n API responses include the following headers to allow clients to determine how close they are to exceeding them limits:\n- **x-ratelimit-minute-limit** permitted number of API calls per minute\n- **x-ratelimit-minute-reset** seconds remaining until minute limit resets\n- **x-ratelimit-minute-remaining** number of calls remaining until reaching limit\n- **x-ratelimit-day-limit** permitted number of API calls per minute\n- **x-ratelimit-day-reset** seconds remaining until minute limit resets\n- **x-ratelimit-day-remaining** number of calls remaining until reaching limit\n\nIf you find you require a higher usage limit, please contact 1Factory support to discuss your use case."
  version: '24.31'
  termsOfService: https://www.1factory.com/resources/TOS%20May%2020%202021.pdf
  contact:
    name: API Support
    url: https://1factoryhelp.zendesk.com/hc/en-us
    email: support@1factory.com
servers:
- url: https://www.1factory.co/api/v1
  description: Sandbox server
- url: https://www.1factory.com/api/v1
  description: Production server
- url: https://val.1factory.co/api/v1
  description: Validated Sandbox server
- url: https://val.1factory.com/api/v1
  description: Validated Production server
- url: https://localhost/api/v1
  description: Local development
security:
- OrgId: []
  ApiKey: []
tags:
- name: QMS
  description: Data related to Quality
paths:
  /qms/ncrs:
    get:
      tags:
      - QMS
      summary: 1Factory Gets a List of NCRs for Your Organization
      description: 'The list of NCRs can be filtered by specifying query parameters.


        Paging parameters control the number of rows NCR objects returned. By default, the first 100 NCRs are returned.'
      parameters:
      - $ref: '#/components/parameters/page'
        example: example-value
      - $ref: '#/components/parameters/pageSize'
        example: example-value
      - $ref: '#/components/parameters/createdAfter'
        example: example-value
      - $ref: '#/components/parameters/createdBefore'
        example: example-value
      - $ref: '#/components/parameters/updatedAfter'
        example: example-value
      - $ref: '#/components/parameters/updatedBefore'
        example: example-value
      - $ref: '#/components/parameters/closedAfter'
        example: example-value
      - $ref: '#/components/parameters/closedBefore'
        example: example-value
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NcrList'
              examples:
                Getqmsncrs200Example:
                  summary: Default getqmsncrs 200 response
                  x-microcks-default: true
                  value:
                  - {}
          description: Returns a list of NCRs, most recently created first. Utilize paging query parameters to query older NCRs. By default the 100 most recent are returned.
        '400':
          $ref: '#/components/responses/InvalidQueryParam'
        '401':
          $ref: '#/components/responses/401'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /qms/capas:
    get:
      tags:
      - QMS
      summary: 1Factory Gets a List of CAPAs for Your Organization
      description: 'The list of CAPAs can be filtered by specifying query parameters.


        Paging parameters control the number of rows CAPA objects returned. By default, the first 100 CAPAs are returned.'
      parameters:
      - $ref: '#/components/parameters/page'
        example: example-value
      - $ref: '#/components/parameters/pageSize'
        example: example-value
      - $ref: '#/components/parameters/createdAfter'
        example: example-value
      - $ref: '#/components/parameters/createdBefore'
        example: example-value
      - $ref: '#/components/parameters/updatedAfter'
        example: example-value
      - $ref: '#/components/parameters/updatedBefore'
        example: example-value
      - $ref: '#/components/parameters/closedAfter'
        example: example-value
      - $ref: '#/components/parameters/closedBefore'
        example: example-value
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CapaList'
              examples:
                Getqmscapas200Example:
                  summary: Default getqmscapas 200 response
                  x-microcks-default: true
                  value:
                  - {}
          description: Returns a list of CAPAs, most recently created first. Utilize paging query parameters to query older CAPAs. By default the 100 most recent are returned.
        '400':
          $ref: '#/components/responses/InvalidQueryParam'
        '401':
          $ref: '#/components/responses/401'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /qms/complaints:
    get:
      tags:
      - QMS
      summary: 1Factory Gets a List of Complaints for Your Organization
      description: 'The list of Complaints can be filtered by specifying query parameters.


        Paging parameters control the number of rows Complaint objects returned. By default, the first 100 Complaints are returned.'
      parameters:
      - $ref: '#/components/parameters/page'
        example: example-value
      - $ref: '#/components/parameters/pageSize'
        example: example-value
      - $ref: '#/components/parameters/createdAfter'
        example: example-value
      - $ref: '#/components/parameters/createdBefore'
        example: example-value
      - $ref: '#/components/parameters/updatedAfter'
        example: example-value
      - $ref: '#/components/parameters/updatedBefore'
        example: example-value
      - $ref: '#/components/parameters/closedAfter'
        example: example-value
      - $ref: '#/components/parameters/closedBefore'
        example: example-value
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ComplaintList'
              examples:
                Getqmscomplaints200Example:
                  summary: Default getqmscomplaints 200 response
                  x-microcks-default: true
                  value:
                  - {}
          description: Returns a list of Complaints, most recently created first. Utilize paging query parameters to query older Complaints. By default the 100 most recent are returned.
        '400':
          $ref: '#/components/responses/InvalidQueryParam'
        '401':
          $ref: '#/components/responses/401'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  schemas:
    Issue:
      type: object
      properties:
        ID:
          $ref: '#/components/schemas/ID'
        number:
          type: number
          example: 1234
          description: The reference number for the NCR, Complaint, or CAPA
        part_number:
          $ref: '#/components/schemas/part_number'
        rev:
          $ref: '#/components/schemas/rev'
        part_description:
          $ref: '#/components/schemas/part_description'
        customer_name:
          $ref: '#/components/schemas/customer_name'
        customer_ident:
          type: string
          nullable: true
          maxLength: 255
          description: 'Your Organization''s custom identifier for customer NCRs (ex. Customer PO #)'
          example: PO-1234
        supplier_name:
          $ref: '#/components/schemas/supplier_name'
        supplier_ident:
          type: string
          nullable: true
          maxLength: 255
          description: 'Your Organization''s custom identifier for supplier NCRs (ex. Supplier Lot #)'
          example: '123456'
        type:
          type: string
          maxLength: 255
          description: Type of NCR
          example: Rcvg.
          enum:
          - Rcvg.
          - Mfg.
          - Field
          - Cust.
          - Devn.
        mfg_insp_ident_1:
          type: string
          nullable: true
          maxLength: 255
          description: 'Your Organization''s custom primary identifier for manufacturing inspection identifiers. (ex. Job #)'
          example: job-20240003
        mfg_insp_ident_2:
          type: string
          nullable: true
          maxLength: 255
          description: 'Your Organization''s custom secondary identifier for manufacturing inspection identifiers. (ex. PO #)'
          example: po-20240065
        rec_insp_ident_1:
          type: string
          nullable: true
          maxLength: 255
          description: 'Your Organization''s custom primary identifier for receiving inspection identifiers. (ex. Job #)'
          example: job-20240003
        rec_insp_ident_2:
          type: string
          nullable: true
          maxLength: 255
          description: 'Your Organization''s custom secondary identifier for receiving inspection identifiers. (ex. PO #)'
          example: po-20240065
        lot_quantity:
          type: number
          nullable: false
          description: The number of parts in the lot of the NCR
          example: 100
        inspection_quantity:
          type: number
          nullable: false
          description: The number of parts in the lot that were inspected as part of the NCR
          example: 10
        defective_quantity:
          type: number
          nullable: false
          description: The number of parts rejected as part of the NCR
          example: 3
        impact:
          type: string
          description: Business impact of the NCR
          example: LOW
          enum:
          - LOW
          - MEDIUM
          - HIGH
        detected_at:
          type: string
          nullable: true
          description: Where the problem for the NCR was detected.
          example: Final Inspection
        problem_type:
          type: string
          nullable: true
          description: A simple description of the problem.
          example: Out-of-spec
        root_cause:
          type: string
          nullable: true
          description: The root cause of the problem.
          example: Machining Error
        caused_by:
          type: string
          nullable: true
          description: The department or group that caused the problem.
          example: Engineering
        problem_summary:
          type: string
          nullable: true
          maxLength: 255
          description: Problem summary of the NCR.
          example: Manufacturing defect
        total_cost:
          type: number
          nullable: true
          description: Cost of the NCR
          example: 1000.0
        status:
          type: string
          description: Status of the NCR
          example: OPEN
          enum:
          - OPEN
          - CLOSED
        task_status:
          type: string
          nullable: false
          description: Status of all tasks on NCR.
          example: OPEN
          enum:
          - N/A
          - OPEN
          - CLOSED
        task_count:
          type: number
          nullable: false
          description: Number of tasks for the NCR.
          example: 3
        owner:
          $ref: '#/components/schemas/owner'
        created_by_name:
          $ref: '#/components/schemas/created_by_username'
        created_on:
          $ref: '#/components/schemas/created_on'
        updated_on:
          $ref: '#/components/schemas/updated_on'
        closed_on:
          $ref: '#/components/schemas/closed_on'
    Complaint:
      type: object
      allOf:
      - $ref: '#/components/schemas/Issue'
      - properties:
          source:
            type: string
            description: Source of the complaint.
            enum:
            - Customer
            - Field
          customer_address:
            type: string
          contact_first_name:
            type: string
          contact_last_name:
            type: string
          contact_email:
            type: string
          contact_phone:
            type: string
          customer_ncr_no:
            type: string
            description: Customer NCR number if available.
          rma_no:
            type: string
          device_identifier:
            type: string
          serial_nos:
            type: string
          capa_required:
            type: boolean
          capa_id:
            type: number
          date_due:
            type: string
            format: date-time
            description: Date & time that a Complaint is due.
            example: '2021-07-21T07:14:42-08:00'
          complaint_on:
            type: string
            format: date-time
            description: Date & time of the original complaint.
            example: '2021-07-21T07:14:42-08:00'
    part_description:
      type: string
      nullable: true
      maxLength: 255
      description: Description of the part.
      example: Three Lobe Shaft
    closed_on:
      type: string
      format: date-time
      description: Date & time that an object was closed.
      example: '2021-07-21T07:14:42-08:00'
    created_by_username:
      type: string
      description: Name of user that created the entity.
      example: Oleg Nickolayev
    NcrList:
      type: array
      minItems: 0
      maxItems: 500
      items:
        $ref: '#/components/schemas/Ncr'
    owner:
      type: string
      description: Name of user that owns the entity.
      example: Oleg Nickolayev
    rev:
      type: string
      nullable: true
      maxLength: 255
      description: Part revision. Together with part number, uniquely identifies a part.
      example: A
    ComplaintList:
      type: array
      minItems: 0
      maxItems: 500
      items:
        $ref: '#/components/schemas/Complaint'
    Capa:
      type: object
      allOf:
      - $ref: '#/components/schemas/Issue'
      - properties:
          date_due:
            type: string
            format: date-time
            description: Date & time that a CAPA is due.
            example: '2021-07-21T07:14:42-08:00'
    ID:
      type: integer
      format: int32
      description: Unique identifier for the Inspection, assigned by 1Factory.
      readOnly: true
      example: 12345
    Ncr:
      type: object
      allOf:
      - $ref: '#/components/schemas/Issue'
      - properties:
          description:
            type: string
            nullable: true
            maxLength: 255
            description: Description of the part.
            example: Three Lobe Shaft
          use_as_is_quantity:
            type: number
            nullable: true
            description: The number of parts that failed inspection that can be used as-is without rework or scrapping.
            example: 3
          scrap_quantity:
            type: number
            nullable: true
            description: The number of parts that failed inspection that must be scrapped.
            example: 3
          return_quantity:
            type: number
            nullable: true
            description: The number of parts that failed inspection that must be returned to the supplier.
            example: 3
          rework_quantity:
            type: number
            nullable: true
            description: The number of parts that failed inspection that can be reworked to pass inspection.
            example: 3
          repair_quantity:
            type: number
            nullable: true
            description: The number of parts that failed inspection that can be repaired to pass inspection.
            example: 3
          no_defect_quantity:
            type: number
            nullable: true
            description: The number of parts in the lot that do not have any defects.
            example: 3
          inventory_location:
            type: string
            nullable: true
            description: ''
            example: Warehouse
          rma_number:
            type: string
            nullable: true
            description: RMA number, if any, for the returned parts in the NCR.
            example: rma-202405
          rework_po:
            type: string
            nullable: true
            description: ''
            example: po-202407-1
          shipment:
            type: string
            nullable: true
            description: Shipment number, if any, for parts in the NCR
            example: ''
          mrb_meeting_notes:
            type: string
            nullable: true
            description: Any meeting notes for this NCR from a MBR meeting.
            example: ''
          mrb_dispositions:
            type: array
            nullable: false
            description: MRB dispositions for this NCR.
            items:
              type: object
              properties:
                type:
                  type: string
                  nullable: false
                  example: REWORK
                qty:
                  type: number
                  example: 2
          serial_numbers:
            type: string
            nullable: true
            description: Serial number(s) for this NCR.
            example: SN123456
    part_number:
      type: string
      maxLength: 255
      description: Part number. Together with rev, uniquely identifies a part.
      example: 10-12345-12
      minLength: 1
    created_on:
      type: string
      format: date-time
      description: Date & time that an object was created.
      example: '2021-07-15T09:14:42-08:00'
    supplier_name:
      type: string
      nullable: true
      description: The name of the supplier (for receiving or supplier inspections).
      example: Acme Industries
    Error:
      properties:
        code:
          type: string
          description: Error code identifying type of error.
        message:
          type: string
          description: Error message.
    CapaList:
      type: array
      minItems: 0
      maxItems: 500
      items:
        $ref: '#/components/schemas/Capa'
    updated_on:
      type: string
      format: date-time
      description: Date & time that an object was last updated.
      example: '2021-07-17T12:14:42-08:00'
    customer_name:
      type: string
      nullable: true
      description: The name of the customer (for manufacturing inspections).
      example: Rocket Company
  parameters:
    createdBefore:
      name: created_before
      in: query
      required: false
      schema:
        type: string
        format: date-time
        example: '2021-07-14T08:00:00-08:00'
      description: Return objects created before the specified date-time
    updatedAfter:
      name: updated_after
      in: query
      required: false
      schema:
        type: string
        format: date-time
        example: '2021-07-14T08:00:00-08:00'
      description: Return objects updated after the specified date-time
    updatedBefore:
      name: updated_before
      in: query
      required: false
      schema:
        type: string
        format: date-time
        example: '2021-07-14T08:00:00-08:00'
      description: Return objects updated before the specified date-time
    page:
      name: page
      in: query
      required: false
      schema:
        type: integer
        format: int32
        minimum: 0
        default: 0
      description: Starting page for queried rows - defaults to 0 (the start of the list). Returned rows will start at index (page * page_size).
    pageSize:
      name: page_size
      in: query
      required: false
      schema:
        type: integer
        format: int32
        minimum: 1
        maximum: 500
        default: 100
      description: The maximum number of records to return from the query. Defaults to 100, maximum value 500.
    closedBefore:
      name: closed_before
      in: query
      required: false
      schema:
        type: string
        format: date-time
        example: '2021-07-14T08:00:00-08:00'
      description: Return only approved or rejected objects closed before the specified date-time.
    closedAfter:
      name: closed_after
      in: query
      required: false
      schema:
        type: string
        format: date-time
        example: '2021-07-14T08:00:00-08:00'
      description: Return only approved or rejected objects closed after the specified date-time.
    createdAfter:
      name: created_after
      in: query
      required: false
      schema:
        type: string
        format: date-time
        example: '2021-07-14T08:00:00-08:00'
      description: Return objects created after the specified date-time
  responses:
    '401':
      description: Unauthorized. Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: FAC-2
            message: Invalid api key. Ensure the value provided in the x-1factory-key request header matches the API key in your 1Factory settings page.
    InvalidQueryParam:
      description: Invalid request. A problem with the request query parameters prevents it from being processed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: FAC-11
            message: 'Invalid query parameter: ''-1'' is not a valid value for ''page_size''.'
  securitySchemes:
    OrgId:
      type: apiKey
      in: header
      name: x-1factory-org
      description: ID of your organization in 1Factory. Available in the Settings page of the 1Factory application.
    ApiKey:
      type: apiKey
      in: header
      name: x-1factory-key
      description: API key for your organization. Generated in the Settings page of the 1Factory application.