{
  "openapi": "3.1.0",
  "info": {
    "title": "Error Details REST API",
    "version": "v1",
    "description": "The details of each error: ObjectsGrid's own, whose responses' instance is the URL to read, and your API's, stored with POST. Read by id or by trace id; no updates, no deletes, no search. Kept 90 days."
  },
  "servers": [
    {
      "url": "https://apis.objectsgrid.com"
    }
  ],
  "paths": {
    "/errordetails": {
      "get": {
        "summary": "The ErrorDetails of a trace",
        "operationId": "listByTrace",
        "description": "The ErrorDetails of one request, found by its trace id: usually one, a few for a GraphQL request. ErrorDetails are read, not searched: traceId is required.",
        "security": [
          {
            "accessTokenAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "X-ObjectsGrid-AccessPoint",
            "description": "EU or US depending on where your Organization Account is located",
            "schema": {
              "type": "string",
              "enum": [
                "EU",
                "US"
              ]
            },
            "required": true
          },
          {
            "in": "header",
            "name": "X-ObjectsGrid-RestApiVersion",
            "description": "This header allows targeting an API version.\nIf you want to target the latest API version set its value to 'latest'\nIf you want to target the latest stable API version set its value to 'stable'\n",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "in": "header",
            "name": "X-ObjectsGrid-SessionID",
            "description": "This header allows you to provide a Session ID to be traced through the request stack and returned in the response.\n",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "in": "query",
            "name": "traceId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{32}$"
            },
            "description": "The request's trace id: X-ObjectsGrid-Trace-Id, or traceId in an error response"
          }
        ],
        "responses": {
          "200": {
            "description": "The trace's ErrorDetails, oldest first",
            "headers": {
              "X-ObjectsGrid-CorrelationID": {
                "description": "The Correlation ID is a unique value generated by ObjectsGrid and used for troubleshooting issues",
                "schema": {
                  "type": "string"
                }
              },
              "X-ObjectsGrid-SessionID": {
                "description": "If your request contained this header, it will be included in the response",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorDetail/v1/schema.json"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests - rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Store one of your API's errors",
        "operationId": "create",
        "security": [
          {
            "accessTokenAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "X-ObjectsGrid-AccessPoint",
            "description": "EU or US depending on where your Organization Account is located",
            "schema": {
              "type": "string",
              "enum": [
                "EU",
                "US"
              ]
            },
            "required": true
          },
          {
            "in": "header",
            "name": "X-ObjectsGrid-RestApiVersion",
            "description": "This header allows targeting an API version.\nIf you want to target the latest API version set its value to 'latest'\nIf you want to target the latest stable API version set its value to 'stable'\n",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "in": "header",
            "name": "X-ObjectsGrid-SessionID",
            "description": "This header allows you to provide a Session ID to be traced through the request stack and returned in the response.\n",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorDetail/v1/schema.json"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successfully created the object",
            "headers": {
              "X-ObjectsGrid-CorrelationID": {
                "description": "The Correlation ID is a unique value generated by ObjectsGrid and used for troubleshooting issues",
                "schema": {
                  "type": "string"
                }
              },
              "X-ObjectsGrid-SessionID": {
                "description": "If your request contained this header, it will be included in the response",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorDetail/v1/schema.json"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests - rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          }
        },
        "description": "A customer's API stores one of its own errors and returns its URL to its caller, as ObjectsGrid's instance does. Its domain is its DefinedTermSet's, never objectsgrid.com. Billed as a write."
      }
    },
    "/errordetails/batch": {
      "post": {
        "summary": "Store up to 100 of your API's errors",
        "operationId": "batchCreate",
        "description": "Creates up to 100 DiscountCodes in one request, all or none: if any of them is not valid, or you may not create\nit, nothing is created, and the error's reasons name the object by its index, as in `/items/3/name`.\nEach object gets its own id, version and event, as with Create object, and is returned as you may read it.\nEach object created counts as one request against the monthly spending cap; a batch that would pass the\ncap is refused (429). Rarely, some objects cannot be stored once the batch was accepted: the response is\nthen 207, each item has its own status, and the others stay created.\n",
        "security": [
          {
            "accessTokenAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "X-ObjectsGrid-AccessPoint",
            "description": "EU or US depending on where your Organization Account is located",
            "schema": {
              "type": "string",
              "enum": [
                "EU",
                "US"
              ]
            },
            "required": true
          },
          {
            "in": "header",
            "name": "X-ObjectsGrid-RestApiVersion",
            "description": "This header allows targeting an API version.\nIf you want to target the latest API version set its value to 'latest'\nIf you want to target the latest stable API version set its value to 'stable'\n",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "in": "header",
            "name": "X-ObjectsGrid-SessionID",
            "description": "This header allows you to provide a Session ID to be traced through the request stack and returned in the response.\n",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "items"
                ],
                "additionalProperties": false,
                "properties": {
                  "items": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 100,
                    "items": {
                      "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorDetail/v1/schema.json"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Every object was created; the items are in the order of the request",
            "headers": {
              "X-ObjectsGrid-CorrelationID": {
                "description": "The Correlation ID is a unique value generated by ObjectsGrid and used for troubleshooting issues",
                "schema": {
                  "type": "string"
                }
              },
              "X-ObjectsGrid-SessionID": {
                "description": "If your request contained this header, it will be included in the response",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchCreateResponse"
                }
              }
            }
          },
          "207": {
            "description": "Some objects could not be stored; each item has its own status, and the others were created",
            "headers": {
              "X-ObjectsGrid-CorrelationID": {
                "description": "The Correlation ID is a unique value generated by ObjectsGrid and used for troubleshooting issues",
                "schema": {
                  "type": "string"
                }
              },
              "X-ObjectsGrid-SessionID": {
                "description": "If your request contained this header, it will be included in the response",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchCreateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request; an object is not valid, or the batch has no objects or more than 100. Nothing was created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized; you may not create one of the objects. Nothing was created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "413": {
            "description": "Payload Too Large; the body exceeds 10 MB, or one of its objects exceeds 1 MB. Nothing was created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests - rate limited, or the batch would pass the monthly spending cap. Nothing was created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          }
        }
      }
    },
    "/errordetails/{id}": {
      "get": {
        "summary": "Read an ErrorDetail",
        "operationId": "retrieve",
        "security": [
          {
            "accessTokenAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID of the object to retrieve"
          },
          {
            "in": "header",
            "name": "X-ObjectsGrid-AccessPoint",
            "description": "EU or US depending on where your Organization Account is located",
            "schema": {
              "type": "string",
              "enum": [
                "EU",
                "US"
              ]
            },
            "required": true
          },
          {
            "in": "header",
            "name": "X-ObjectsGrid-RestApiVersion",
            "description": "This header allows targeting an API version.\nIf you want to target the latest API version set its value to 'latest'\nIf you want to target the latest stable API version set its value to 'stable'\n",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "in": "header",
            "name": "X-ObjectsGrid-SessionID",
            "description": "This header allows you to provide a Session ID to be traced through the request stack and returned in the response.\n",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved the object",
            "headers": {
              "X-ObjectsGrid-CorrelationID": {
                "description": "The Correlation ID is a unique value generated by ObjectsGrid and used for troubleshooting issues",
                "schema": {
                  "type": "string"
                }
              },
              "X-ObjectsGrid-SessionID": {
                "description": "If your request contained this header, it will be included in the response",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorDetail/v1/schema.json"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "404": {
            "description": "No such ErrorDetail (OBJECT_NOT_FOUND), or not stored yet (ERROR_DETAIL_NOT_READY, with Retry-After)",
            "headers": {
              "Retry-After": {
                "description": "With ERROR_DETAIL_NOT_READY: the seconds to wait before reading again",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          }
        },
        "description": "The error at an error response's instance. For 30 seconds after the error it may not be stored yet: 404 ERROR_DETAIL_NOT_READY with Retry-After. Readers: administrators, and the accounts the access policy allows (action read on ErrorDetail)."
      }
    }
  },
  "components": {
    "securitySchemes": {
      "accessTokenAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "Bearer JWT",
        "description": "An ObjectsGrid access token (a JWT), sent as 'Authorization: Bearer <token>': from POST /oauth2/token, valid 1 hour, or an API key: a service account's from the bootstrap of an Organization Account created without signing in, valid 90 days; a public service account's (POST /serviceaccounts/{id}/apikey, or the bootstrap's anonymous one), without expiry, until its account is disabled or deleted."
      }
    },
    "schemas": {}
  }
}
