Macrometa Origins API

The Origins API from Macrometa — 2 operation(s) for origins.

OpenAPI Specification

macrometa-origins-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Macrometa API Reference Activity Metrics Origins API
  version: 0.17.17
  description: API reference for the Macrometa Global Data Network.
  license:
    name: Macrometa License, Version 2.0
servers:
- url: https://api-play.paas.macrometa.io
  description: GDN API
host: api-play.paas.macrometa.io
security:
- ApiKeyAuth: []
- BearerAuth: []
tags:
- name: Origins
paths:
  /api/prerender/v1/origins:
    get:
      summary: Get origins
      tags:
      - Origins
      description: Returns all origins.
      parameters:
      - schema:
          type: string
        in: header
        name: x-photoniq-customerid
        required: true
        description: Customer unique identifier.
      responses:
        '200':
          description: Origins fetched successfully.
          content:
            application/json:
              schema:
                type: array
                description: Origins fetched successfully.
                items:
                  type: object
                  properties:
                    _key:
                      type: string
                      description: Origin unique identifier.
                    origin:
                      type: string
                      format: uri
                      description: Origin base URL.
                    siteMaps:
                      type: array
                      items:
                        type: string
                        description: Sitemap path.
                      description: List of sitemap paths.
                    identifyNotfound:
                      type: string
                      description: Text present on the rendered page HTML that signifies a not found error page (404). If this specific text appears on the rendered page, the HTTP status code of the response will be 404. For instance, if the text "Sorry, the page you were looking for could not be found." is included on your not found error page, this text can serve as the identifier.
                    allowOriginHeaderValue:
                      type: string
                      description: Value of x-photoniq-prerender-request header.
                    passThroughHeaders:
                      type: array
                      items:
                        type: string
                        description: Header key.
                      description: List of header keys that are forwarded from the bot request to the origin website.
                    addResponseHeaders:
                      type: object
                      additionalProperties:
                        type: object
                        properties:
                          basedOnStatusCode:
                            type: boolean
                            description: Whether the header value should be based on the response status code.
                          value:
                            oneOf:
                            - type: string
                              description: Header value.
                            - type: object
                              description: Status code. Ranges like 2xx can also be used.
                              additionalProperties:
                                type: string
                                description: Header value.
                        required:
                        - basedOnStatusCode
                        - value
                        description: Additional response headers configuration.
                      description: Map of headers to add to the response.
                    caching:
                      type: boolean
                      description: Whether to cache rendered pages.
                    ttl:
                      type: number
                      description: Cache lifetime of rendered pages (in seconds).
                    created:
                      type: string
                      format: date-time
                      description: Date when the origin was created.
                    lastUpdated:
                      type: string
                      format: date-time
                      description: Date when the origin was updated.
                  required:
                  - _key
                  - origin
                  - siteMaps
                  - caching
                  - ttl
                  - created
                example:
                - _key: www_origin_com
                  origin: https://www.origin.com
                  siteMaps:
                  - /sitemap.xml
                  identifyNotfound: Page Not Found
                  allowOriginHeaderValue: 948ef5f9-f15f-4b61-91b3-305b77db30e9
                  passThroughHeaders:
                  - accept-language
                  - user-agent
                  addResponseHeaders:
                    cache-control:
                      basedOnStatusCode: true
                      value:
                        2xx: public, max-age=86400
                        3xx: public, max-age=7200
                        4xx: no-store
                        5xx: no-store
                    x-prerender-provider:
                      basedOnStatusCode: false
                      value: PhotonIQ
                  caching: false
                  ttl: 86400
                  created: '2023-01-01T00:00:00.000Z'
                  lastUpdated: '2023-02-02T00:00:00.000Z'
                - _key: sub_origin_com
                  origin: https://sub.origin.com
                  siteMaps:
                  - /sitemap.xml
                  identifyNotfound: Page Not Found
                  allowOriginHeaderValue: 0641e52b-aa25-45dc-9e4f-7298b959d87c
                  passThroughHeaders:
                  - accept-language
                  - user-agent
                  addResponseHeaders:
                    cache-control:
                      basedOnStatusCode: true
                      value:
                        2xx: public, max-age=86400
                        3xx: public, max-age=7200
                        4xx: no-store
                        5xx: no-store
                    x-prerender-provider:
                      basedOnStatusCode: false
                      value: PhotonIQ
                  caching: false
                  ttl: 86400
                  created: '2023-01-01T00:00:00.000Z'
                  lastUpdated: '2023-02-02T00:00:00.000Z'
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                type: object
                description: Bad request.
                properties:
                  status:
                    type: string
                    description: Error status.
                  message:
                    type: string
                    description: Error message.
                required:
                - status
                - message
                example:
                  status: ERROR
                  message: Header x-photoniq-customerid is required.
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                type: object
                description: Internal server error.
                properties:
                  status:
                    type: string
                    description: Error status.
                  message:
                    type: string
                    description: Error message.
                required:
                - status
                - message
                example:
                  status: ERROR
                  message: Internal server error.
    post:
      summary: Create origin
      tags:
      - Origins
      description: Creates an origin.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                origin:
                  type: string
                  format: uri
                  description: Origin base URL.
                siteMaps:
                  type: array
                  items:
                    type: string
                    description: Sitemap path.
                  description: List of sitemap paths.
                identifyNotfound:
                  type: string
                  description: Text present on the rendered page HTML that signifies a not found error page (404). If this specific text appears on the rendered page, the HTTP status code of the response will be 404. For instance, if the text "Sorry, the page you were looking for could not be found." is included on your not found error page, this text can serve as the identifier.
                allowOriginHeaderValue:
                  type: string
                  description: Value of x-photoniq-prerender-request header.
                passThroughHeaders:
                  type: array
                  items:
                    type: string
                    description: Header key.
                  description: List of header keys that are forwarded from the bot request to the origin website.
                addResponseHeaders:
                  type: object
                  additionalProperties:
                    type: object
                    properties:
                      basedOnStatusCode:
                        type: boolean
                        description: Whether the header value should be based on the response status code.
                      value:
                        oneOf:
                        - type: string
                          description: Header value.
                        - type: object
                          description: Status code. Ranges like 2xx can also be used.
                          additionalProperties:
                            type: string
                            description: Header value.
                    required:
                    - basedOnStatusCode
                    - value
                    description: Additional response headers configuration.
                  description: Map of headers to add to the response.
                caching:
                  type: boolean
                  description: Whether to cache rendered pages.
                ttl:
                  type: number
                  description: Cache lifetime of rendered pages (in seconds).
              required:
              - origin
              - siteMaps
              - ttl
              - caching
            example:
              origin: https://www.origin.com
              siteMaps:
              - /sitemap.xml
              identifyNotfound: Page Not Found
              allowOriginHeaderValue: 948ef5f9-f15f-4b61-91b3-305b77db30e9
              passThroughHeaders:
              - accept-language
              - user-agent
              addResponseHeaders:
                cache-control:
                  basedOnStatusCode: true
                  value:
                    2xx: public, max-age=86400
                    3xx: public, max-age=7200
                    4xx: no-store
                    5xx: no-store
                x-prerender-provider:
                  basedOnStatusCode: false
                  value: PhotonIQ
              caching: false
              ttl: 86400
        required: true
      parameters:
      - schema:
          type: string
        in: header
        name: x-photoniq-customerid
        required: true
        description: Customer unique identifier.
      responses:
        '200':
          description: Origin created successfully.
          content:
            application/json:
              schema:
                type: object
                description: Origin created successfully.
                properties:
                  _key:
                    type: string
                    description: Origin unique identifier.
                required:
                - _key
                example:
                  _key: www_origin_com
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                type: object
                description: Bad request.
                properties:
                  status:
                    type: string
                    description: Error status.
                  message:
                    type: string
                    description: Error message.
                required:
                - status
                - message
                example:
                  status: ERROR
                  message: Header x-photoniq-customerid is required.
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                type: object
                description: Internal server error.
                properties:
                  status:
                    type: string
                    description: Error status.
                  message:
                    type: string
                    description: Error message.
                required:
                - status
                - message
                example:
                  status: ERROR
                  message: Internal server error.
  /api/prerender/v1/origins/{origin}:
    get:
      summary: Get origin
      tags:
      - Origins
      description: Returns an origin.
      parameters:
      - schema:
          type: string
          minLength: 1
        example: www.origin.com
        in: path
        name: origin
        required: true
        description: Origin hostname.
      - schema:
          type: string
        in: header
        name: x-photoniq-customerid
        required: true
        description: Customer unique identifier.
      responses:
        '200':
          description: Origin fetched successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  _key:
                    type: string
                    description: Origin unique identifier.
                  origin:
                    type: string
                    format: uri
                    description: Origin base URL.
                  siteMaps:
                    type: array
                    items:
                      type: string
                      description: Sitemap path.
                    description: List of sitemap paths.
                  identifyNotfound:
                    type: string
                    description: Text present on the rendered page HTML that signifies a not found error page (404). If this specific text appears on the rendered page, the HTTP status code of the response will be 404. For instance, if the text "Sorry, the page you were looking for could not be found." is included on your not found error page, this text can serve as the identifier.
                  allowOriginHeaderValue:
                    type: string
                    description: Value of x-photoniq-prerender-request header.
                  passThroughHeaders:
                    type: array
                    items:
                      type: string
                      description: Header key.
                    description: List of header keys that are forwarded from the bot request to the origin website.
                  addResponseHeaders:
                    type: object
                    additionalProperties:
                      type: object
                      properties:
                        basedOnStatusCode:
                          type: boolean
                          description: Whether the header value should be based on the response status code.
                        value:
                          oneOf:
                          - type: string
                            description: Header value.
                          - type: object
                            description: Status code. Ranges like 2xx can also be used.
                            additionalProperties:
                              type: string
                              description: Header value.
                      required:
                      - basedOnStatusCode
                      - value
                      description: Additional response headers configuration.
                    description: Map of headers to add to the response.
                  caching:
                    type: boolean
                    description: Whether to cache rendered pages.
                  ttl:
                    type: number
                    description: Cache lifetime of rendered pages (in seconds).
                  created:
                    type: string
                    format: date-time
                    description: Date when the origin was created.
                  lastUpdated:
                    type: string
                    format: date-time
                    description: Date when the origin was updated.
                required:
                - _key
                - origin
                - siteMaps
                - caching
                - ttl
                - created
                description: Origin fetched successfully.
                example:
                  _key: www_origin_com
                  origin: https://www.origin.com
                  siteMaps:
                  - /sitemap.xml
                  identifyNotfound: Page Not Found
                  allowOriginHeaderValue: 948ef5f9-f15f-4b61-91b3-305b77db30e9
                  passThroughHeaders:
                  - accept-language
                  - user-agent
                  addResponseHeaders:
                    cache-control:
                      basedOnStatusCode: true
                      value:
                        2xx: public, max-age=86400
                        3xx: public, max-age=7200
                        4xx: no-store
                        5xx: no-store
                    x-prerender-provider:
                      basedOnStatusCode: false
                      value: PhotonIQ
                  caching: false
                  ttl: 86400
                  created: '2023-01-01T00:00:00.000Z'
                  lastUpdated: '2023-02-02T00:00:00.000Z'
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                type: object
                description: Bad request.
                properties:
                  status:
                    type: string
                    description: Error status.
                  message:
                    type: string
                    description: Error message.
                required:
                - status
                - message
                example:
                  status: ERROR
                  message: Header x-photoniq-customerid is required.
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                type: object
                description: Not found.
                properties:
                  status:
                    type: string
                    description: Error status.
                  message:
                    type: string
                    description: Error message.
                required:
                - status
                - message
                example:
                  status: ERROR
                  message: Not found.
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                type: object
                description: Internal server error.
                properties:
                  status:
                    type: string
                    description: Error status.
                  message:
                    type: string
                    description: Error message.
                required:
                - status
                - message
                example:
                  status: ERROR
                  message: Internal server error.
    patch:
      summary: Update origin
      tags:
      - Origins
      description: Updates an origin.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                siteMaps:
                  type: array
                  items:
                    type: string
                    description: Sitemap path.
                  description: List of sitemap paths.
                identifyNotfound:
                  type: string
                  description: Text present on the rendered page HTML that signifies a not found error page (404). If this specific text appears on the rendered page, the HTTP status code of the response will be 404. For instance, if the text "Sorry, the page you were looking for could not be found." is included on your not found error page, this text can serve as the identifier.
                allowOriginHeaderValue:
                  type: string
                  description: Value of x-photoniq-prerender-request header.
                passThroughHeaders:
                  type: array
                  items:
                    type: string
                    description: Header key.
                  description: List of header keys that are forwarded from the bot request to the origin website.
                addResponseHeaders:
                  type: object
                  additionalProperties:
                    type: object
                    properties:
                      basedOnStatusCode:
                        type: boolean
                        description: Whether the header value should be based on the response status code.
                      value:
                        oneOf:
                        - type: string
                          description: Header value.
                        - type: object
                          description: Status code. Ranges like 2xx can also be used.
                          additionalProperties:
                            type: string
                            description: Header value.
                    required:
                    - basedOnStatusCode
                    - value
                    description: Additional response headers configuration.
                  description: Map of headers to add to the response.
                caching:
                  type: boolean
                  description: Whether to cache rendered pages.
                ttl:
                  type: number
                  description: Cache lifetime of rendered pages (in seconds).
            example:
              siteMaps:
              - /sitemap.xml
              identifyNotfound: Page Not Found
              allowOriginHeaderValue: 948ef5f9-f15f-4b61-91b3-305b77db30e9
              passThroughHeaders:
              - accept-language
              - user-agent
              addResponseHeaders:
                cache-control:
                  basedOnStatusCode: true
                  value:
                    2xx: public, max-age=86400
                    3xx: public, max-age=7200
                    4xx: no-store
                    5xx: no-store
                x-prerender-provider:
                  basedOnStatusCode: false
                  value: PhotonIQ
              caching: false
              ttl: 86400
      parameters:
      - schema:
          type: string
          minLength: 1
        example: www.origin.com
        in: path
        name: origin
        required: true
        description: Origin hostname.
      - schema:
          type: string
        in: header
        name: x-photoniq-customerid
        required: true
        description: Customer unique identifier.
      responses:
        '200':
          description: Origin updated successfully.
          content:
            application/json:
              schema:
                type: object
                description: Origin updated successfully.
                properties:
                  _key:
                    type: string
                    description: Origin unique identifier.
                required:
                - _key
                example:
                  _key: www_origin_com
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                type: object
                description: Bad request.
                properties:
                  status:
                    type: string
                    description: Error status.
                  message:
                    type: string
                    description: Error message.
                required:
                - status
                - message
                example:
                  status: ERROR
                  message: Header x-photoniq-customerid is required.
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                type: object
                description: Not found.
                properties:
                  status:
                    type: string
                    description: Error status.
                  message:
                    type: string
                    description: Error message.
                required:
                - status
                - message
                example:
                  status: ERROR
                  message: Not found.
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                type: object
                description: Internal server error.
                properties:
                  status:
                    type: string
                    description: Error status.
                  message:
                    type: string
                    description: Error message.
                required:
                - status
                - message
                example:
                  status: ERROR
                  message: Internal server error.
    delete:
      summary: Delete origin
      tags:
      - Origins
      description: Deletes an origin.
      parameters:
      - schema:
          type: string
          minLength: 1
        example: www.origin.com
        in: path
        name: origin
        required: true
        description: Origin hostname.
      - schema:
          type: string
        in: header
        name: x-photoniq-customerid
        required: true
        description: Customer unique identifier.
      responses:
        '200':
          description: Origin deleted successfully.
          content:
            application/json:
              schema:
                type: object
                description: Origin deleted successfully.
                properties:
                  _key:
                    type: string
                    description: Origin unique identifier.
                required:
                - _key
                example:
                  _key: www_origin_com
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                type: object
                description: Bad request.
                properties:
                  status:
                    type: string
                    description: Error status.
                  message:
                    type: string
                    description: Error message.
                required:
                - status
                - message
                example:
                  status: ERROR
                  message: Header x-photoniq-customerid is required.
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                type: object
                description: Not found.
                properties:
                  status:
                    type: string
                    description: Error status.
                  message:
                    type: string
                    description: Error message.
                required:
                - status
                - message
                example:
                  status: ERROR
                  message: Not found.
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                type: object
                description: Internal server error.
                properties:
                  status:
                    type: string
                    description: Error status.
                  message:
                    type: string
                    description: Error message.
                required:
                - status
                - message
                example:
                  status: ERROR
                  message: Internal server error.
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: 'Provide an API Key to the `Authorization` header, prefixed with "apikey".


        Example: `Authorization: apikey <key>`'
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Provide a JSON Web Token (JWT) to the `Authorization` header, prefixed with "bearer".


        Example: `Authorization: bearer <jwt>`'