> ## Documentation Index
> Fetch the complete documentation index at: https://docs.enterspeed.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Save entity

> Starting the process for saving the entity.

This endpoint can be used in two ways:

- **Raw**: The body contains the raw source entity and the required meta data is provided as header parameters.
- **Simplified**: The source entity is given `properties` of the body which also includes meta data.




## OpenAPI

````yaml /enterspeed/enterspeedv1Api.yaml post /ingest/v2/{originId}
openapi: 3.0.0
info:
  version: 0.4.0
  title: API documentation
  description: >-
    The Enterspeed API are based on REST principles.


    Before you start you will need to [create an
    Enterspeed-account](https://app.enterspeed.com) and set up a tenant (a
    property for your website). Here you can create

    - A data source (provides you with an API key for the **Ingest API**).

    - An environment client (provides you with an API key for the **Delivery
    API** and **Query API**).

    - A domain (ensure the correct data gets fetched).


    🎉 Have fun using our API. Make sure to [contact
    us](https://www.enterspeed.com/contact) if you need any help. We're happy
    assist!
  x-logo:
    url: https://docs.enterspeed.com/img/logo.svg
    altText: Enterspeed Logo
  license:
    name: See Enterspeed Terms of service
    url: https://www.enterspeed.com/terms-of-service
servers:
  - url: https://api.enterspeed.com
    description: General API
security: []
tags:
  - name: Delivery
    description: >-
      The Delivery API is what you use to `GET` your data from Enterspeed to
      your frontend project. Before you can fetch your content from Enterspeed,
      you first need to create an **Environment client** which generates an API
      key. This is done under *Settings --> Environment settings*.


      You can find an example of how to fetch data [Umbraco & Next.js
      tutorial](https://docs.enterspeed.com/tutorials/umbraco-nextjs/fetching-data-in-nextjs).
  - name: Ingest
    description: >-
      The Ingest API is used to `POST` your current data sources into
      Enterspeed. Before you can start ingesting data, you'll need to create a
      **Data source** inside Enterspeed, which generates an API key. This is
      done under *Settings --> Data sources*.


      The Ingest API can also be used to `DELETE` already ingested data from
      Enterspeed.
  - name: Routes
    description: >-
      The Routes API is what you use to `GET` all available URL routes for a
      specific environment, which can be helpful for SSG (Static Site
      Generation) or creating a sitemap.


      Before you can fetch your routes from Enterspeed, you first need to create
      an **Environment client** which generates an API key. This is done under
      *Settings --> Environment settings*.


      **ℹ NOTE:** The `first` or `last` parameter is required and must be set
      between 100 - 500 (e.g. `first=250`). Both are not allowed at the same
      time.
  - name: Query
    description: >-
      The Query API is what you use to query items from your indexes.


      Before you can query your indexes from Enterspeed, you first need to
      create an **Environment client** which generates an API key. This is done
      under *Settings --> Environment settings*.
paths:
  /ingest/v2/{originId}:
    post:
      tags:
        - Ingest
      summary: Save entity
      description: >
        Starting the process for saving the entity.


        This endpoint can be used in two ways:


        - **Raw**: The body contains the raw source entity and the required meta
        data is provided as header parameters.

        - **Simplified**: The source entity is given `properties` of the body
        which also includes meta data.
      operationId: saveEntity
      parameters:
        - name: originId
          in: path
          required: true
          description: >
            Id of the entity. Must be same format for all entities within the
            same source.

            Eg. integers, guids, etc.
          schema:
            type: string
            example: '1'
        - name: X-Api-Key
          required: true
          in: header
          description: Api key to validate your source.
          schema:
            type: string
            example: source-90880177-e9a1-47b3-9a40-7b728a6bafd8
        - name: X-Enterspeed-Type
          required: true
          in: header
          description: >
            The type or alias of the type of entity being send to process.

            Eg. blogList, blogPage, frontPage, etc.

            Only used for raw body


            The type is immutable after initial ingest. If an entity with the
            same originId already exists and the type differs, the ingest will
            be rejected with a type change error in the response. Type
            comparison is case-sensitive. To change the entity type, delete the
            entity and re-ingest with the new type, or use
            X-Enterspeed-Force-Type to override.
          schema:
            type: string
            example: product
        - name: X-Enterspeed-Force-Type
          required: false
          in: header
          description: >
            Optional header to override type immutability validation. Include
            this header to bypass the type immutability check and allow
            re-ingesting an entity with a different type. This is a destructive
            operation that rebuilds affected views. Use only when intentional
            type changes are required.


            The value needs to be one of `true`, `TRUE`, `1`.
          schema:
            type: string
            example: 'true'
        - name: X-Enterspeed-Url
          in: header
          description: >
            If the entity is routable send the URL. Skip if entity is not
            routable.

            Only used for raw body. 

            Note: The URL needs to begin with a leading slash.
          schema:
            type: string
            example: /product-1
        - name: X-Enterspeed-OriginParentId
          in: header
          description: |
            Allowed as null if no hierarchy exists.
            Only used for raw body
          schema:
            type: string
            example: '2'
        - name: X-Enterspeed-Redirects
          in: header
          description: >
            Comma separated list of URLs that redirects to the current page. Eg.
            https://enterspeed.com/product-1-old/ redirecting to
            https://enterspeed.com/product-1/.
          schema:
            type: string
            example: /product-old,/product-very-old
        - name: Content-Length
          required: true
          in: header
          description: >
            The length of the message body, in bytes (this header is
            automatically added by most clients). 


            Note: The endpoint does not support `Transfer-Encoding: chunked`.
            `JsonContent` and `PostAsJsonAsync` in .NET will by default set the
            `Transfer-Encoding: chunked` header. Use types like e.g.
            `StringContent` or `ByteArrayContent` instead.
          schema:
            type: number
      requestBody:
        description: The entity to process
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/Raw'
                - $ref: '#/components/schemas/Simplified'
      responses:
        '200':
          description: >-
            Valid request. Processing of posted entity has begun or source
            entity hasn't changed and won't be processed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: number
                    example: 200
                  message:
                    type: string
                    example: Processing has been initiated.
              example:
                status: 200
                message: Processing has been initiated.
        '401':
          description: Unauthorized. Missing X-Api-Key header or the X-Api-Key is invalid.
        '413':
          description: |
            Payload Too Large. The entity is too large to process.

            Returns ErrorApiResponse with status, errorCode, and message.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: number
                    example: 413
                  message:
                    type: string
                    description: Error message explaining the payload size issue
                    example: >-
                      Source entity size exceeds 5,242,880B. Actual size
                      10,485,760B
                  errorCode:
                    type: string
                    example: s-1007
              example:
                status: 413
                message: Source entity size exceeds 5,242,880B. Actual size 10,485,760B
                errorCode: s-1007
        '422':
          description: >
            Unprocessable Entity. The request was well-formed but was unable to
            be followed due to semantic errors.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: number
                    example: 422
                  message:
                    type: string
                    description: Error message explaining the validation failure
                    example: Invalid request
                  errorCode:
                    type: string
                    example: s-1001
                  errors:
                    type: object
                    description: Dictionary mapping field names to error message strings
                    additionalProperties:
                      type: string
              example:
                status: 422
                message: Invalid request
                errorCode: s-1001
                errors:
                  type: >-
                    Type cannot be changed from 'product' to 'productVariant'.
                    Use the X-Enterspeed-Force-Type header to override, or
                    delete the source entity first.
        '500':
          description: >
            Internal Server Error. Something went wrong on our end while
            processing the request.
          content:
            text/plain:
              schema:
                type: string
              example: Internal server error
components:
  schemas:
    Raw:
      type: object
      description: Headers required
      example:
        name: Official Enterspeed T-shirt
        price: 199.99
        inStock: true
        features:
          - name: color
            value: blue
          - name: size
            value: M
        information:
          short: Nice t-shirt
          long: Nice t-shirt in cotton.
      additionalProperties:
        description: |
          Property names:
            - cannot start with a digit
            - cannot consist only of underscores
            - can contain A-Z, a-z letters, digits and underscores
        anyOf:
          - type: string
          - type: number
          - type: boolean
          - type: array
          - type: object
    Simplified:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          description: >
            The type or alias of the type of entity being send to process. Eg.
            blogList, blogPage, frontPage, etc. Only used for raw body
        url:
          type: string
          description: |
            If the entity is routable send the URL. Otherwise leave as
            null.  

            Allowed as null if entity is not routable.

            Note: The URL needs to begin with a leading slash.
        originParentId:
          type: string
          example: '123'
          description: Allowed as null if no hierarchy exists.
        redirects:
          type: array
          description: >
            URLs that redirects to the current page. Eg.
            https://enterspeed.com/product-enterspeed-tshirt-old/ redirecting to
            https://enterspeed.com/product-enterspeed-tshirt/.
          items:
            type: string
            example: https://enterspeed.com/product-enterspeed-tshirt-old/
        properties:
          description: |
            Property names:
              - cannot start with a digit
              - cannot consist only of underscores
              - can contain A-Z, a-z letters, digits and underscores
          example:
            name: Official Enterspeed T-shirt
            price: 199.99
            inStock: true
            features:
              - name: color
                value: blue
              - name: size
                value: M
            information:
              short: Nice t-shirt
              long: Nice t-shirt in cotton
          additionalProperties:
            anyOf:
              - type: string
              - type: number
              - type: boolean
              - type: array
              - type: object

````