{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/safetyculture/json-schema/safetyculture-s12-contractors-v1-list-contractor-companies-response-schema.json",
  "title": "s12.contractors.v1.ListContractorCompaniesResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/safetyculture-companies-api-openapi.yml#/components/schemas/s12.contractors.v1.ListContractorCompaniesResponse",
  "type": "object",
  "properties": {
    "contractor_company_list": {
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "#/$defs/s12.contractors.v1.ContractorCompany"
      },
      "description": "The contractor companies that were retrieved."
    },
    "next_page_token": {
      "type": "string",
      "description": "The next page token."
    },
    "total_count": {
      "type": "integer",
      "format": "int32",
      "description": "The total number of contractor companies that match the filter."
    },
    "total_count_needs_attention": {
      "type": "integer",
      "format": "int32",
      "description": "The total number of contractor companies that match the filter + need attention."
    }
  },
  "$defs": {
    "s12.common.Language": {
      "type": "string",
      "enum": [
        "LANGUAGE_UNSPECIFIED",
        "LANGUAGE_EN_US",
        "LANGUAGE_EN_GB",
        "LANGUAGE_DE_DE",
        "LANGUAGE_ES_ES",
        "LANGUAGE_FR_FR",
        "LANGUAGE_PT_BR",
        "LANGUAGE_NL_NL"
      ],
      "default": "LANGUAGE_UNSPECIFIED",
      "description": "- LANGUAGE_UNSPECIFIED: Language unspecified\n - LANGUAGE_EN_US: Language en-US\n - LANGUAGE_EN_GB: Language en-GB\n - LANGUAGE_DE_DE: Language de-DE\n - LANGUAGE_ES_ES: Language es-ES\n - LANGUAGE_FR_FR: Language fr-FR\n - LANGUAGE_PT_BR: Language pt-BR\n - LANGUAGE_NL_NL: Language nl-NL",
      "title": "Language represents the languages offered in SafetyCulture"
    },
    "s12.common.Media": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "token": {
          "type": "string"
        },
        "filename": {
          "type": "string",
          "description": "full file name, including file extension"
        },
        "media_type": {
          "$ref": "#/$defs/s12.common.MediaType"
        }
      },
      "title": "Represents an image or video"
    },
    "s12.common.MediaType": {
      "type": "string",
      "enum": [
        "MEDIA_TYPE_IMAGE",
        "MEDIA_TYPE_VIDEO",
        "MEDIA_TYPE_PDF",
        "MEDIA_TYPE_DOCX",
        "MEDIA_TYPE_XLSX",
        "MEDIA_TYPE_PPTX",
        "MEDIA_TYPE_CSV"
      ],
      "description": " - MEDIA_TYPE_IMAGE: An image file (GIF, JPG, PNG, WEBP).\n - MEDIA_TYPE_VIDEO: A video file (MP4, MOV).\n - MEDIA_TYPE_PDF: A PDF document.\n - MEDIA_TYPE_DOCX: A Microsoft Word document (DOCX, DOC).\n - MEDIA_TYPE_XLSX: A Microsoft Excel spreadsheet (XLSX, XLS).\n - MEDIA_TYPE_PPTX: A Microsoft PowerPoint presentation (PPTX, PPT).\n - MEDIA_TYPE_CSV: A CSV file."
    },
    "s12.common.SubscriptionSeatTypes": {
      "type": "string",
      "enum": [
        "SUBSCRIPTION_SEAT_TYPE_UNSPECIFIED",
        "SUBSCRIPTION_SEAT_TYPE_PREMIUM",
        "SUBSCRIPTION_SEAT_TYPE_COLLABORATOR",
        "SUBSCRIPTION_SEAT_TYPE_LITE",
        "SUBSCRIPTION_SEAT_TYPE_SERVICE_USER",
        "SUBSCRIPTION_SEAT_TYPE_SUPPORT"
      ],
      "default": "SUBSCRIPTION_SEAT_TYPE_UNSPECIFIED",
      "title": "SubscriptionSeatTypes is a list of potential subscription seat types"
    },
    "s12.common.UserActiveStatus": {
      "type": "string",
      "enum": [
        "USER_ACTIVE_STATUS_UNSPECIFIED",
        "USER_ACTIVE_STATUS_ACTIVE",
        "USER_ACTIVE_STATUS_DEACTIVATED"
      ],
      "default": "USER_ACTIVE_STATUS_UNSPECIFIED",
      "description": "- USER_ACTIVE_STATUS_UNSPECIFIED: Status is unknown or not specified\n - USER_ACTIVE_STATUS_ACTIVE: User is active\n - USER_ACTIVE_STATUS_DEACTIVATED: User has been deactivated",
      "title": "UserActiveStatus enumerates possible states of 'status' a user may be in"
    },
    "s12.common.UserDocument": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "UUID of the user"
        },
        "email": {
          "type": "string",
          "description": "Email of the user"
        },
        "first_name": {
          "type": "string",
          "description": "First name of the user"
        },
        "last_name": {
          "type": "string",
          "description": "Last name of the user"
        },
        "timezone": {
          "type": "string",
          "description": "What timezone the user is in"
        },
        "profile_picture": {
          "type": "string",
          "description": "URL of the profile picture of the user"
        },
        "status": {
          "allOf": [
            {
              "$ref": "#/$defs/s12.common.UserActiveStatus"
            }
          ],
          "description": "Status of the user's account"
        },
        "external_mappings": {
          "allOf": [
            {
              "$ref": "#/$defs/s12.common.UserDocument.UserExternalMappings"
            }
          ],
          "description": "External systems related to this user (e.g. EddApp connections, etc.)"
        },
        "seat_type": {
          "allOf": [
            {
              "$ref": "#/$defs/s12.common.SubscriptionSeatTypes"
            }
          ],
          "description": "Type of seat the user is associated with, based on their subscription"
        },
        "profile_image": {
          "allOf": [
            {
              "$ref": "#/$defs/s12.common.Media"
            }
          ],
          "description": "Profile token and image of user"
        },
        "last_seen": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp of when the user last interacted with the system. May be empty."
        },
        "email_confirmed": {
          "type": "boolean",
          "description": "Whether or not the user has confirmed their email."
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp of when the user was created."
        },
        "language": {
          "allOf": [
            {
              "$ref": "#/$defs/s12.common.Language"
            }
          ],
          "description": "Language of the user"
        },
        "phone_number": {
          "type": "string",
          "description": "Phone number of the user"
        }
      },
      "title": "UserDocument contains all information about a user"
    },
    "s12.common.UserDocument.UserExternalMappings": {
      "type": "object",
      "properties": {
        "edapp_id": {
          "type": "string"
        }
      },
      "title": "UserExternalMappings defines third-party details associated with a user's account"
    },
    "s12.contractors.v1.Address": {
      "type": "object",
      "properties": {
        "sub_premise": {
          "type": "string",
          "description": "A first-order entity below a named location\neg. Building, floor level, or suite"
        },
        "street_number": {
          "type": "string",
          "description": "Street number"
        },
        "street": {
          "type": "string",
          "description": "Street name"
        },
        "city": {
          "type": "string",
          "description": "City or locality"
        },
        "administrative_area_level_2": {
          "type": "string",
          "description": "deprecated. For output, this will return the value of administrative_area_level for backward compatibility."
        },
        "administrative_area_level_1": {
          "type": "string",
          "description": "A first-order civil entity below the country level. These do not exist in all countries.\neg. within the United States: state or province, within the UK: county, within Australia: state"
        },
        "postal_code": {
          "type": "string",
          "description": "Postal code"
        },
        "country_code": {
          "type": "string",
          "description": "Country code (ISO 3166-1 alpha-2)"
        }
      }
    },
    "s12.contractors.v1.CompanyComplianceStatistics": {
      "type": "object",
      "properties": {
        "expired_document_count": {
          "type": "integer",
          "format": "int32",
          "description": "The number of company documents that have expired."
        },
        "expiring_soon_document_count": {
          "type": "integer",
          "format": "int32",
          "description": "The number of company documents that are expiring soon.\nThe service hard-codes \"expiring soon\" as documents that are expiring within the next 30 days."
        },
        "pending_approval_document_count": {
          "type": "integer",
          "format": "int32",
          "description": "The number of company documents that are pending approval."
        }
      },
      "description": "CompanyComplianceStatistics is a message that contains statistics about a contractor company's compliance."
    },
    "s12.contractors.v1.CompanyContactDetails": {
      "type": "object",
      "properties": {
        "email": {
          "type": "string",
          "description": "The email address of the company."
        },
        "phone_number": {
          "type": "string",
          "description": "The phone number of the company."
        },
        "address": {
          "description": "The address of the company.",
          "allOf": [
            {
              "$ref": "#/$defs/s12.contractors.v1.Address"
            }
          ]
        }
      },
      "description": "Contact details associated with a contractor company."
    },
    "s12.contractors.v1.CompanyUserCredentialComplianceStatistics": {
      "type": "object",
      "properties": {
        "expired_user_credential_count": {
          "type": "integer",
          "format": "int32",
          "description": "The number of user credentials that have expired."
        },
        "expiring_soon_user_credential_count": {
          "type": "integer",
          "format": "int32",
          "description": "The number of user credentials that are expiring soon."
        },
        "pending_approval_user_credential_count": {
          "type": "integer",
          "format": "int32",
          "description": "The number of user credentials that are pending approval."
        },
        "total_user_credential_count": {
          "type": "integer",
          "format": "int32",
          "description": "The total number of user credentials."
        }
      },
      "description": "CompanyUserCredentialComplianceStatistics is a message that contains statistics about a contractor company's users' credential compliance."
    },
    "s12.contractors.v1.ContractorCompany": {
      "type": "object",
      "properties": {
        "company_id": {
          "type": "string",
          "description": "The ID of the company."
        },
        "attributes": {
          "description": "Any intrinsic attributes associated with a company.",
          "allOf": [
            {
              "$ref": "#/$defs/s12.contractors.v1.ContractorCompanyAttributes"
            }
          ]
        },
        "metadata": {
          "description": "Any metadata associated with a company.",
          "allOf": [
            {
              "$ref": "#/$defs/s12.contractors.v1.ContractorCompanyMetadata"
            }
          ]
        },
        "company_type": {
          "description": "The type of the company.",
          "allOf": [
            {
              "$ref": "#/$defs/s12.typefield.v1.Type"
            }
          ]
        }
      },
      "description": "A contractor company."
    },
    "s12.contractors.v1.ContractorCompanyAttributes": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the company."
        },
        "contact_details": {
          "description": "The contact details of the company.",
          "allOf": [
            {
              "$ref": "#/$defs/s12.contractors.v1.CompanyContactDetails"
            }
          ]
        },
        "image": {
          "description": "Image to be associated with the company.",
          "allOf": [
            {
              "$ref": "#/$defs/s12.common.Media"
            }
          ]
        },
        "external_reference_id": {
          "type": "string",
          "description": "An optional external reference ID for the company that is used in external systems. Enforces uniqueness."
        },
        "status": {
          "description": "The status of the company.",
          "allOf": [
            {
              "$ref": "#/$defs/s12.contractors.v1.ContractorCompanyStatus"
            }
          ]
        },
        "compliance_statistics": {
          "description": "The compliance statistics of the company.",
          "allOf": [
            {
              "$ref": "#/$defs/s12.contractors.v1.CompanyComplianceStatistics"
            }
          ]
        },
        "user_credential_compliance_statistics": {
          "description": "The user credential compliance statistics of the company.\nOnly populated for users with credential management permissions.",
          "allOf": [
            {
              "$ref": "#/$defs/s12.contractors.v1.CompanyUserCredentialComplianceStatistics"
            }
          ]
        },
        "notes": {
          "type": "string",
          "description": "An internal note about the company, visible only to users with admin:companies permission."
        },
        "site_ids": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The IDs of the sites to associate with this company.\nOn create: links all provided sites to the new company.\nOn update: replaces the full set of site associations (include in update_mask to apply)."
        },
        "linked_sites": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/$defs/s12.contractors.v1.ContractorCompanyLinkedSite"
          },
          "description": "The sites currently linked to this company, including resolved site names.\nPopulated on read responses only; to modify the site associations use site_ids.",
          "readOnly": true
        },
        "outstanding_document_request_count": {
          "type": "integer",
          "format": "int32",
          "description": "The number of document requests made to this company that are still outstanding.\nA request is outstanding when the company has not uploaded a document against it,\nor when the document they uploaded was rejected.\n\nPopulated on list responses only. Endpoints that return a single company leave it at 0,\nso do not read it from those; call the list endpoint if you need this count.",
          "readOnly": true
        }
      },
      "description": "Intrinsic attributes associated with a contractor company."
    },
    "s12.contractors.v1.ContractorCompanyLinkedSite": {
      "type": "object",
      "properties": {
        "site_id": {
          "type": "string",
          "description": "The ID of the linked site."
        },
        "site_name": {
          "type": "string",
          "description": "The display name of the linked site."
        }
      },
      "description": "A site linked to a contractor company, including its resolved name."
    },
    "s12.contractors.v1.ContractorCompanyMetadata": {
      "type": "object",
      "properties": {
        "created_by_user": {
          "description": "@deprecated. Use created_by_user_doc.",
          "allOf": [
            {
              "$ref": "#/$defs/s12.contractors.v1.User"
            }
          ]
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "description": "The creation date of the company"
        },
        "last_modified_by_user": {
          "description": "@deprecated. Use last_modified_by_user_doc.",
          "allOf": [
            {
              "$ref": "#/$defs/s12.contractors.v1.User"
            }
          ]
        },
        "last_modified": {
          "type": "string",
          "format": "date-time",
          "description": "The last modified date of the company"
        },
        "created_by_user_doc": {
          "description": "The creator of a credential version.",
          "allOf": [
            {
              "$ref": "#/$defs/s12.common.UserDocument"
            }
          ]
        },
        "last_modified_by_user_doc": {
          "description": "The user who last edited a credential version.",
          "allOf": [
            {
              "$ref": "#/$defs/s12.common.UserDocument"
            }
          ]
        },
        "notes_updated_by": {
          "type": "string",
          "description": "The user ID of the last person who edited the internal notes."
        },
        "notes_updated_at": {
          "type": "string",
          "format": "date-time",
          "description": "The timestamp of when the internal notes were last updated."
        }
      },
      "description": "Metadata associated with a contractor company."
    },
    "s12.contractors.v1.ContractorCompanyStatus": {
      "type": "string",
      "enum": [
        "CONTRACTOR_COMPANY_STATUS_ACTIVE",
        "CONTRACTOR_COMPANY_STATUS_PENDING",
        "CONTRACTOR_COMPANY_STATUS_DEACTIVATED"
      ],
      "description": "The status of a contractor company.\n\n - CONTRACTOR_COMPANY_STATUS_ACTIVE: The company is active.\n - CONTRACTOR_COMPANY_STATUS_PENDING: The company is pending approval.\n - CONTRACTOR_COMPANY_STATUS_DEACTIVATED: The company is deactivated."
    },
    "s12.contractors.v1.User": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The ID of the user."
        },
        "first_name": {
          "type": "string",
          "description": "The first name of the user."
        },
        "last_name": {
          "type": "string",
          "description": "The last name of the user."
        }
      },
      "description": "Information about a SafetyCulture user."
    },
    "s12.typefield.v1.Domain": {
      "type": "string",
      "enum": [
        "DOMAIN_UNSPECIFIED",
        "DOMAIN_GLOBAL",
        "DOMAIN_ASSETS",
        "DOMAIN_CONTRACTORS",
        "DOMAIN_LICENSES_AND_CREDENTIALS",
        "DOMAIN_TASKS",
        "DOMAIN_USERS",
        "DOMAIN_INVESTIGATIONS",
        "DOMAIN_STRUCTURES",
        "DOMAIN_INTEGRATIONS_HRIS_STAGING"
      ],
      "default": "DOMAIN_UNSPECIFIED",
      "description": "The domain is used to specify which domain the data is coming from.\nThis allows the shared generic type field service to keep track of which domain owns the data,\nand enforce any domain-specific access control rules.\n\n - DOMAIN_UNSPECIFIED: Domain Unspecified.\n - DOMAIN_GLOBAL: Owned and managed by system can be used by multiple domains\n - DOMAIN_ASSETS: Owned and created from Assets domain\n - DOMAIN_CONTRACTORS: Owned and created from Contractor Management domain\n - DOMAIN_LICENSES_AND_CREDENTIALS: Owned and created from the Licenses and Credentials domain\n - DOMAIN_TASKS: Owned and created from the Tasks domain\n - DOMAIN_USERS: Owned and created from the Users domain\n - DOMAIN_INVESTIGATIONS: Owned and created from the Investigations domain\n - DOMAIN_STRUCTURES: Owned and created from the Organisational Structures domain\n - DOMAIN_INTEGRATIONS_HRIS_STAGING: Owned and created from the Integrations domain"
    },
    "s12.typefield.v1.Type": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "A global unique identifier for a type."
        },
        "name": {
          "type": "string",
          "description": "Name of the type."
        },
        "description": {
          "type": "string",
          "description": "Description of the type."
        },
        "type_category": {
          "description": "Type category. Cannot be updated.",
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/$defs/s12.typefield.v1.TypeCategory"
            }
          ]
        },
        "domain": {
          "description": "The domain of type. Cannot be updated.",
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/$defs/s12.typefield.v1.Domain"
            }
          ]
        },
        "stats": {
          "description": "Additional stats associated with a type.",
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/$defs/s12.typefield.v1.TypeStats"
            }
          ]
        }
      },
      "description": "Describes the values of a type."
    },
    "s12.typefield.v1.TypeCategory": {
      "type": "string",
      "enum": [
        "TYPE_CATEGORY_UNSPECIFIED",
        "TYPE_CATEGORY_SYSTEM",
        "TYPE_CATEGORY_CUSTOM"
      ],
      "default": "TYPE_CATEGORY_UNSPECIFIED",
      "description": "- TYPE_CATEGORY_UNSPECIFIED: Type Unspecified.\n - TYPE_CATEGORY_SYSTEM: Type pre-defined.\n - TYPE_CATEGORY_CUSTOM: Type custom.",
      "title": "TypeCategory defines if it's system or user created type"
    },
    "s12.typefield.v1.TypeStats": {
      "type": "object",
      "properties": {
        "mapping_count": {
          "type": "integer",
          "format": "int32",
          "description": "The total number of mappings associated with a type."
        }
      },
      "description": "Stats associated with a type."
    }
  }
}