{
  "openapi": "3.0.1",
  "info": {
    "title": "Worldfavor External API",
    "description": "The Worldfavor API lets your own systems work with the data in your Worldfavor account. Keep your companies in sync, read the answers about them, and manage products. Your integration can use as much or as little of it as it needs.\n\nYou don't need a connector. Any integration platform, ERP, procurement system or BI tool that can call an HTTP API can use it directly.\n\n## At a glance\n| | |\n| --- | --- |\n| Format | REST over HTTPS, JSON |\n| Authentication | OAuth 2.0 client credentials, tokens valid for 24 hours |\n| Pages | Up to 1000 items per request |\n| Rate limit | 1000 requests per minute per access token |\n\n## Get access\nAsk your customer success manager to enable API access. You'll get a client ID and a client secret, which give access to your account's data only.\n\nKeep the secret in your integration's server-side configuration, never in code that runs in a browser or an app. If you think it has been exposed, contact us and we'll rotate it.\n\n## Quickstart\n**1. Get a token.**\n```bash\ncurl --request POST 'https://dev.auth.worldfavor.com/oauth/token' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n    \"grant_type\": \"client_credentials\",\n    \"client_id\": \"YOUR_CLIENT_ID\",\n    \"client_secret\": \"YOUR_CLIENT_SECRET\",\n    \"audience\": \"https://dev.worldfavor.com\"\n  }'\n```\nThe response contains an `access_token` that is valid for 24 hours. Reuse it until it expires.\n\n**2. Call the API.** Replace `BASE_URL` with the address in the **Base URL** box.\n```bash\ncurl 'BASE_URL/companies?pageSize=10' \\\n  --header 'Authorization: Bearer YOUR_ACCESS_TOKEN'\n```\n\n## Concepts\n- **Identifiers.** Most records have a Worldfavor `id`, and data that belongs to a company includes its `companyId`. You can give a company your own identifier too, `customId`, such as its id in your ERP.\n\n## Data format\nField names are camelCase. Timestamps are in UTC, `yyyy-MM-ddTHH:mm:ssZ`. Country codes are lowercase ISO 3166-1 alpha-2, such as `se`. New fields can be added to responses, so ignore fields you don't recognize.\n\n## Pagination\nList endpoints take two paging parameters:\n\n| Parameter | Default | Description |\n| --- | --- | --- |\n| `pageNumber` | `1` | The page to return, starting from 1 |\n| `pageSize` | `25` | Items per page, at most 1000 |\n\nEach response is one page in this format:\n```json\n{\n    \"pageNumber\": 1,\n    \"pageSize\": 100,\n    \"pageCount\": 3,\n    \"totalItems\": 214,\n    \"items\": [ ]\n}\n```\n\n## Date filters\nA date filter takes a date, such as `2026-09-01`, which covers the whole day in UTC. Any other format returns `400`.\n\nPut a prefix in front of the value to choose how it's compared:\n\n| Prefix | Meaning |\n| --- | --- |\n| `eq` | Equal to (the default) |\n| `gt` | Greater than |\n| `ge` | Greater than or equal to |\n| `lt` | Less than |\n| `le` | Less than or equal to |\n\n## Status codes\nThe API uses standard HTTP status codes.\n\n| Status | Meaning |\n| --- | --- |\n| `200` `201` `204` | Succeeded, created, deleted |\n| `400` | A parameter is missing or not valid, or the request body can't be read |\n| `401` | The access token is missing, invalid or expired |\n| `404` | Not found in your account |\n| `409` | Conflicts with existing data, such as a product that already exists |\n| `422` | The request body is not valid. Nothing was saved, and `errors` lists each problem. |\n| `429` | Rate limit exceeded. Wait and try again. |\n| `500` | An unexpected error, logged on our side |\n\n## Try it from this page\nEnter your client ID and secret in the **Authentication** box and click **Authorize**. Then open any endpoint and click **Test Request**. The page keeps your credentials only until you close or reload it, and sends the secret only to the token endpoint.",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://test.api.worldfavor.com/v1"
    }
  ],
  "paths": {
    "/assessments": {
      "get": {
        "tags": [
          "Assessments"
        ],
        "summary": "Get assessments",
        "description": "Get a paginated list of assessment results",
        "parameters": [
          {
            "name": "companyId",
            "in": "query",
            "description": "Id of the company should be equal this, specified as a list of comma-separated values.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "assessmentTemplateId",
            "in": "query",
            "description": "Id of the assessment template should be equal this, specified as a list of comma-separated values.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "period",
            "in": "query",
            "description": "Year to filter assessments by (e.g. 2026).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "level",
            "in": "query",
            "description": "Level to filter assessments by.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageNumber",
            "in": "query",
            "description": "The page to return, starting from 1.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Items per page, at most 1000. A larger value is reduced to 1000.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 25
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedAssessmentResult"
                }
              }
            }
          },
          "400": {
            "description": "A parameter is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The rate limit was exceeded. Wait and try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/companies": {
      "get": {
        "tags": [
          "Companies"
        ],
        "summary": "Get companies",
        "description": "Returns the companies in your account.",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "description": "Worldfavor id of the company.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "name",
            "in": "query",
            "description": "Matches companies whose name contains this.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customId",
            "in": "query",
            "description": "Matches companies whose customId contains this.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "vatNumber",
            "in": "query",
            "description": "Matches companies whose VAT number contains this.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "registrationNumber",
            "in": "query",
            "description": "Matches companies whose registration number contains this.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dunsNumber",
            "in": "query",
            "description": "Matches companies whose DUNS number contains this.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageNumber",
            "in": "query",
            "description": "The page to return, starting from 1.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Items per page, at most 1000. A larger value is reduced to 1000.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 25
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of companies.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedCompanyResult"
                }
              }
            }
          },
          "400": {
            "description": "A parameter is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The rate limit was exceeded. Wait and try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/contacts": {
      "get": {
        "tags": [
          "Contacts"
        ],
        "summary": "Get contacts",
        "description": "Returns the contacts at your companies.",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "description": "Matches contacts whose name contains this.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "email",
            "in": "query",
            "description": "Matches contacts whose email address contains this.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageNumber",
            "in": "query",
            "description": "The page to return, starting from 1.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Items per page, at most 1000. A larger value is reduced to 1000.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 25
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of contacts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedContactResult"
                }
              }
            }
          },
          "400": {
            "description": "A parameter is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The rate limit was exceeded. Wait and try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/expectations": {
      "get": {
        "tags": [
          "Expectations"
        ],
        "summary": "Get expectations",
        "description": "Get a paginated list of supplier improvement expectations",
        "parameters": [
          {
            "name": "companyId",
            "in": "query",
            "description": "Id of the company should be equal this, specified as a list of comma-separated values.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "assessmentTemplateId",
            "in": "query",
            "description": "Id of the assessment template should be equal this, specified as a list of comma-separated values.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageNumber",
            "in": "query",
            "description": "The page to return, starting from 1.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Items per page, at most 1000. A larger value is reduced to 1000.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 25
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedExpectationResult"
                }
              }
            }
          },
          "400": {
            "description": "A parameter is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The rate limit was exceeded. Wait and try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/productRelations": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "Get product relations",
        "description": "Returns the product relations in your account.",
        "parameters": [
          {
            "name": "gtin",
            "in": "query",
            "description": "Matches relations whose product GTIN contains this.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "productNumber",
            "in": "query",
            "description": "Matches relations whose product number contains this.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "purchaseOrder",
            "in": "query",
            "description": "Matches relations whose purchase order number contains this.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageNumber",
            "in": "query",
            "description": "The page to return, starting from 1.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Items per page, at most 1000. A larger value is reduced to 1000.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 25
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of product relations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedProductRelationResult"
                }
              }
            }
          },
          "400": {
            "description": "A parameter is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The rate limit was exceeded. Wait and try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/products": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "Get products",
        "description": "Returns the products in your account.",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "description": "Worldfavor id of the product.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "name",
            "in": "query",
            "description": "Matches products whose name contains this.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "gtin",
            "in": "query",
            "description": "Matches products whose GTIN contains this.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "productCustomId",
            "in": "query",
            "description": "Matches products whose productCustomId contains this.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "productNumber",
            "in": "query",
            "description": "Matches products whose product number contains this.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "purchaseOrder",
            "in": "query",
            "description": "Matches products whose purchase order number contains this.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageNumber",
            "in": "query",
            "description": "The page to return, starting from 1.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Items per page, at most 1000. A larger value is reduced to 1000.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 25
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of products.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedProductResult"
                }
              }
            }
          },
          "400": {
            "description": "A parameter is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The rate limit was exceeded. Wait and try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Products"
        ],
        "summary": "Create product",
        "description": "Creates a product. The combination of name and GTIN must be unique, and so must the name when GTIN is empty. Identify the company that supplies the product with `companyId` or `companyCustomId`.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/CreateProduct"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The product was created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Product"
                }
              }
            }
          },
          "400": {
            "description": "The request body is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "A product with this name and GTIN already exists.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The provided data was not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrors"
                }
              }
            }
          },
          "429": {
            "description": "The rate limit was exceeded. Wait and try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/products/{id}": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "Get product",
        "description": "Returns the product with this Worldfavor id.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Worldfavor id of the product.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The product.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Product"
                }
              }
            }
          },
          "400": {
            "description": "A parameter is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No product has this id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The rate limit was exceeded. Wait and try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Products"
        ],
        "summary": "Update product",
        "description": "Updates the product with this Worldfavor id. The combination of name and GTIN must be unique, and so must the name when GTIN is empty. Identify the company that supplies the product with `companyId` or `companyCustomId`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Worldfavor id of the product.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/UpdateProduct"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The product was updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Product"
                }
              }
            }
          },
          "400": {
            "description": "A parameter or the request body is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No product has this id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The provided data was not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrors"
                }
              }
            }
          },
          "429": {
            "description": "The rate limit was exceeded. Wait and try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Products"
        ],
        "summary": "Delete product",
        "description": "Deletes the product with this Worldfavor id.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Worldfavor id of the product.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "The product was deleted."
          },
          "400": {
            "description": "A parameter is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No product has this id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The rate limit was exceeded. Wait and try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/answers": {
      "get": {
        "tags": [
          "Reported answers"
        ],
        "summary": "Get reported answer",
        "description": "Get a paginated list of all reported answers",
        "parameters": [
          {
            "name": "companyId",
            "in": "query",
            "description": "Id of the company should be equal this, specified as a list of comma-separated values.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "questionnaireId",
            "in": "query",
            "description": "Id of the questionnaire should be equal this, specified as a list of comma-separated values.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "questionId",
            "in": "query",
            "description": "Id of the question should be equal this, specified as a list of comma-separated values.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "questionType",
            "in": "query",
            "description": "Question type should be equal this. Possible values are Text, Number, File or Options.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "reportedAt",
            "in": "query",
            "description": "Reported date of the answer in the format YYYY-MM-DD. A prefix to the parameter value can be used to control the nature of the matching.\n| Prefix | Meaning |\n|--------|---------|\n| `eq` | Will match if the field is *equal to* the value |\n| `gt` | Will match if the field is *greater than* the value |\n| `lt` | Will match if the field is *less than* the value |\n| `ge` | Will match if the field is *greater than or equal to* the value |\n| `le` | Will match if the field is *less than or equal to* the value |\n\nIf no prefix is present, the prefix `eq` is assumed.\n\nFor example: `/answers?reportedAt=gt2024-06-30` would match on answers with a reported date *greater than* 2024-06-30",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "isLatest",
            "in": "query",
            "description": "If answers should come from the latest submitted response per request. Leave it undefined to get all answers.<br />Possible values are `true` or `false`",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "pageNumber",
            "in": "query",
            "description": "The page to return, starting from 1.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Items per page, at most 1000. A larger value is reduced to 1000.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 25
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedAnswerResult"
                }
              }
            }
          },
          "400": {
            "description": "A parameter is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The rate limit was exceeded. Wait and try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Answer": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "companyId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "company": {
            "type": "string",
            "nullable": true
          },
          "targetProductId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "reportedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "expiresAt": {
            "type": "string",
            "nullable": true
          },
          "estimatedAnswerAt": {
            "type": "string",
            "nullable": true
          },
          "questionnaireId": {
            "type": "integer",
            "format": "int32"
          },
          "questionnaire": {
            "type": "string",
            "nullable": true
          },
          "section": {
            "type": "string",
            "nullable": true
          },
          "questionId": {
            "type": "integer",
            "format": "int32"
          },
          "question": {
            "type": "string",
            "nullable": true
          },
          "questionType": {
            "type": "string",
            "nullable": true
          },
          "period": {
            "type": "string",
            "nullable": true
          },
          "periodStartsAt": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "periodEndsAt": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "unit": {
            "type": "string",
            "nullable": true
          },
          "skipped": {
            "type": "boolean"
          },
          "answerStatus": {
            "type": "string",
            "nullable": true
          },
          "answer": {
            "type": "string",
            "nullable": true
          },
          "numberAnswer": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "fileAnswer": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "optionsAnswer": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "comment": {
            "type": "string",
            "nullable": true
          },
          "verification": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Verification"
              }
            ],
            "nullable": true
          },
          "responseVerification": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Verification"
              }
            ],
            "nullable": true
          },
          "flagged": {
            "type": "boolean"
          },
          "flagger": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Assessment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "companyId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "company": {
            "type": "string",
            "nullable": true
          },
          "assessmentTemplateId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "assessmentTemplate": {
            "type": "string",
            "nullable": true
          },
          "period": {
            "type": "string",
            "nullable": true
          },
          "level": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "assessedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Company": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Worldfavor id of the company",
            "format": "int32",
            "nullable": true
          },
          "createdAt": {
            "type": "string",
            "description": "When the company was created in Worldfavor",
            "format": "date-time"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "customId": {
            "type": "string",
            "description": "Your own identifier for the company",
            "nullable": true
          },
          "countryCode": {
            "type": "string",
            "description": "Country code, for example `se`",
            "nullable": true
          },
          "vatNumber": {
            "type": "string",
            "description": "VAT number",
            "nullable": true
          },
          "registrationNumber": {
            "type": "string",
            "description": "Company registration number",
            "nullable": true
          },
          "dunsNumber": {
            "type": "string",
            "description": "DUNS number",
            "nullable": true
          },
          "website": {
            "type": "string",
            "nullable": true
          },
          "owner": {
            "type": "string",
            "description": "Name of the user in your organization who owns the company in Worldfavor. The first one, when there are several.",
            "nullable": true
          },
          "status": {
            "type": "string",
            "description": "`Created` when added by your organization, `Invited` when invited to Worldfavor, or `Connected` when the company has connected its own Worldfavor account",
            "nullable": true
          },
          "activityStatus": {
            "type": "string",
            "description": "`Active`, `Inactive` or `Closed`. Null when not set.",
            "nullable": true
          },
          "supplierUsage": {
            "type": "string",
            "description": "`Direct` or `Indirect`. Null when not set.",
            "nullable": true
          },
          "approvalStatus": {
            "type": "string",
            "description": "`Approved`, `Approved after consideration`, `Under observation` or `Not approved`. Null when not set.",
            "nullable": true
          },
          "riskAssessment": {
            "type": "string",
            "description": "The risk rating set on the company: `Low risk`, `Medium risk`, `High risk` or `Extreme risk`. Null when not set.",
            "nullable": true
          },
          "priority": {
            "type": "string",
            "description": "`Very high`, `High`, `Medium`, `Low` or `Not a priority`. Null when not set.",
            "nullable": true
          },
          "tier": {
            "type": "string",
            "description": "The company's supply chain tier, for example `1`. Null when not set.",
            "nullable": true
          },
          "customCategories": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Contact": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "jobTitle": {
            "type": "string",
            "description": "Job title",
            "nullable": true
          },
          "phoneNumber": {
            "type": "string",
            "description": "Phone number",
            "nullable": true
          },
          "company": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Company"
              }
            ],
            "description": "The company the contact belongs to",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CreateProduct": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "minLength": 1,
            "type": "string",
            "description": "Name of the product"
          },
          "gtin": {
            "type": "string",
            "description": "GTIN of the product",
            "nullable": true
          },
          "productCustomId": {
            "type": "string",
            "description": "Your own identifier for the product",
            "nullable": true
          },
          "productNumber": {
            "type": "string",
            "description": "Product number",
            "nullable": true
          },
          "purchaseOrder": {
            "type": "string",
            "description": "Purchase order number",
            "nullable": true
          },
          "countryCode": {
            "type": "string",
            "description": "Country code of the product in ISO 3166-1 alpha-2 format, for example `se`",
            "nullable": true
          },
          "productStatus": {
            "type": "string",
            "description": "`Active` or `Inactive`",
            "nullable": true
          },
          "mappingStatus": {
            "type": "string",
            "description": "`Not mapped`, `Partly mapped` or `Fully mapped`",
            "nullable": true
          },
          "companyId": {
            "type": "integer",
            "description": "Worldfavor id of the company that supplies the product. Send this or `companyCustomId`.",
            "format": "int32",
            "nullable": true
          },
          "companyCustomId": {
            "type": "string",
            "description": "Your own identifier for the company that supplies the product. Send this or `companyId`.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Error": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "What went wrong",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Expectation": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "companyId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "company": {
            "type": "string",
            "nullable": true
          },
          "assessmentTemplateId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "assessmentTemplate": {
            "type": "string",
            "nullable": true
          },
          "startLevel": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "currentLevel": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "targetLevel": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "dueAt": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "completedAt": {
            "type": "string",
            "format": "date",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PaginatedAnswerResult": {
        "type": "object",
        "properties": {
          "pageNumber": {
            "type": "integer",
            "description": "The page returned, starting from 1",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "The maximum number of items per page",
            "format": "int32"
          },
          "pageCount": {
            "type": "integer",
            "description": "The total number of pages",
            "format": "int32"
          },
          "totalItems": {
            "type": "integer",
            "description": "The total number of items across all pages",
            "format": "int64"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Answer"
            },
            "description": "The items on this page"
          }
        },
        "additionalProperties": false
      },
      "PaginatedAssessmentResult": {
        "type": "object",
        "properties": {
          "pageNumber": {
            "type": "integer",
            "description": "The page returned, starting from 1",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "The maximum number of items per page",
            "format": "int32"
          },
          "pageCount": {
            "type": "integer",
            "description": "The total number of pages",
            "format": "int32"
          },
          "totalItems": {
            "type": "integer",
            "description": "The total number of items across all pages",
            "format": "int64"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Assessment"
            },
            "description": "The items on this page"
          }
        },
        "additionalProperties": false
      },
      "PaginatedCompanyResult": {
        "type": "object",
        "properties": {
          "pageNumber": {
            "type": "integer",
            "description": "The page returned, starting from 1",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "The maximum number of items per page",
            "format": "int32"
          },
          "pageCount": {
            "type": "integer",
            "description": "The total number of pages",
            "format": "int32"
          },
          "totalItems": {
            "type": "integer",
            "description": "The total number of items across all pages",
            "format": "int64"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Company"
            },
            "description": "The items on this page"
          }
        },
        "additionalProperties": false
      },
      "PaginatedContactResult": {
        "type": "object",
        "properties": {
          "pageNumber": {
            "type": "integer",
            "description": "The page returned, starting from 1",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "The maximum number of items per page",
            "format": "int32"
          },
          "pageCount": {
            "type": "integer",
            "description": "The total number of pages",
            "format": "int32"
          },
          "totalItems": {
            "type": "integer",
            "description": "The total number of items across all pages",
            "format": "int64"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Contact"
            },
            "description": "The items on this page"
          }
        },
        "additionalProperties": false
      },
      "PaginatedExpectationResult": {
        "type": "object",
        "properties": {
          "pageNumber": {
            "type": "integer",
            "description": "The page returned, starting from 1",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "The maximum number of items per page",
            "format": "int32"
          },
          "pageCount": {
            "type": "integer",
            "description": "The total number of pages",
            "format": "int32"
          },
          "totalItems": {
            "type": "integer",
            "description": "The total number of items across all pages",
            "format": "int64"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Expectation"
            },
            "description": "The items on this page"
          }
        },
        "additionalProperties": false
      },
      "PaginatedProductRelationResult": {
        "type": "object",
        "properties": {
          "pageNumber": {
            "type": "integer",
            "description": "The page returned, starting from 1",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "The maximum number of items per page",
            "format": "int32"
          },
          "pageCount": {
            "type": "integer",
            "description": "The total number of pages",
            "format": "int32"
          },
          "totalItems": {
            "type": "integer",
            "description": "The total number of items across all pages",
            "format": "int64"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductRelation"
            },
            "description": "The items on this page"
          }
        },
        "additionalProperties": false
      },
      "PaginatedProductResult": {
        "type": "object",
        "properties": {
          "pageNumber": {
            "type": "integer",
            "description": "The page returned, starting from 1",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "The maximum number of items per page",
            "format": "int32"
          },
          "pageCount": {
            "type": "integer",
            "description": "The total number of pages",
            "format": "int32"
          },
          "totalItems": {
            "type": "integer",
            "description": "The total number of items across all pages",
            "format": "int64"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Product"
            },
            "description": "The items on this page"
          }
        },
        "additionalProperties": false
      },
      "Product": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Worldfavor id of the product",
            "format": "int32"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "gtin": {
            "type": "string",
            "description": "GTIN of the product",
            "nullable": true
          },
          "productCustomId": {
            "type": "string",
            "description": "Your own identifier for the product",
            "nullable": true
          },
          "productNumber": {
            "type": "string",
            "description": "Product number",
            "nullable": true
          },
          "purchaseOrder": {
            "type": "string",
            "description": "Purchase order number",
            "nullable": true
          },
          "countryCode": {
            "type": "string",
            "description": "Country code of the product, for example `se`",
            "nullable": true
          },
          "productStatus": {
            "type": "string",
            "description": "`Active` or `Inactive`. Null when not set.",
            "nullable": true
          },
          "mappingStatus": {
            "type": "string",
            "description": "`Not mapped`, `Partly mapped` or `Fully mapped`. Null when not set.",
            "nullable": true
          },
          "industry": {
            "type": "string",
            "nullable": true
          },
          "supplier": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Company"
              }
            ],
            "description": "The company that supplies the product",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ProductRelation": {
        "type": "object",
        "properties": {
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "tier": {
            "type": "integer",
            "format": "int32"
          },
          "product": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Product"
              }
            ],
            "nullable": true
          },
          "productSupplier": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Company"
              }
            ],
            "nullable": true
          },
          "fromActorType": {
            "type": "string",
            "nullable": true
          },
          "fromActorTypeGroup": {
            "type": "string",
            "nullable": true
          },
          "fromSupplier": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Company"
              }
            ],
            "nullable": true
          },
          "toActorType": {
            "type": "string",
            "nullable": true
          },
          "toActorTypeGroup": {
            "type": "string",
            "nullable": true
          },
          "toSupplier": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Company"
              }
            ],
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "UpdateProduct": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the product",
            "nullable": true
          },
          "gtin": {
            "type": "string",
            "description": "GTIN of the product",
            "nullable": true
          },
          "productCustomId": {
            "type": "string",
            "description": "Your own identifier for the product",
            "nullable": true
          },
          "productNumber": {
            "type": "string",
            "description": "Product number",
            "nullable": true
          },
          "purchaseOrder": {
            "type": "string",
            "description": "Purchase order number",
            "nullable": true
          },
          "countryCode": {
            "type": "string",
            "description": "Country code of the product in ISO 3166-1 alpha-2 format, for example `se`",
            "nullable": true
          },
          "productStatus": {
            "type": "string",
            "description": "`Active` or `Inactive`",
            "nullable": true
          },
          "mappingStatus": {
            "type": "string",
            "description": "`Not mapped`, `Partly mapped` or `Fully mapped`",
            "nullable": true
          },
          "companyId": {
            "type": "integer",
            "description": "Worldfavor id of the company that supplies the product. Send this or `companyCustomId`.",
            "format": "int32",
            "nullable": true
          },
          "companyCustomId": {
            "type": "string",
            "description": "Your own identifier for the company that supplies the product. Send this or `companyId`.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ValidationErrorItem": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string",
            "description": "The field, as a path such as `categories[0].tags[1]`",
            "nullable": true
          },
          "message": {
            "type": "string",
            "description": "What is wrong with it",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ValidationErrors": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "nullable": true,
            "readOnly": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ValidationErrorItem"
            },
            "description": "Each problem, with the field it concerns",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Verification": {
        "type": "object",
        "properties": {
          "externalStatus": {
            "type": "string",
            "description": "The status shared with the company: `Approved` or `Correction needed`",
            "nullable": true
          },
          "externalComment": {
            "type": "string",
            "description": "The comment shared with the company",
            "nullable": true
          },
          "internalStatus": {
            "type": "string",
            "description": "The status kept within your organization: `Approved` or `Not approved`",
            "nullable": true
          },
          "internalComment": {
            "type": "string",
            "description": "The comment kept within your organization",
            "nullable": true
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "OAuth2": {
        "type": "oauth2",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://dev.auth.worldfavor.com/oauth/token",
            "scopes": { }
          }
        }
      }
    }
  },
  "security": [
    {
      "OAuth2": [ ]
    }
  ],
  "tags": [
    {
      "name": "Companies",
      "description": "The companies in your Worldfavor account."
    },
    {
      "name": "Contacts",
      "description": "The contacts at your companies."
    },
    {
      "name": "Assessments",
      "description": "Assessment results for your companies."
    },
    {
      "name": "Expectations",
      "description": "Improvement expectations set for your companies."
    },
    {
      "name": "Reported answers",
      "description": "Answers your companies have reported."
    },
    {
      "name": "Products",
      "description": "Products and product relations. You can also create, update and delete products."
    }
  ]
}