Skip to content

Create product

Viewing v1, superseded by v2

POST
/v1/workspaces/{workspace_id}/projects/{project_id}/products
curl --request POST \
--url https://api.app.layer.ai/api/v1/workspaces/:workspace_id/projects/:project_id/products \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "<string>",
"type": "app",
"identifiers": [
{
"type": "url",
"identifier": "<string>"
}
]
}'

v1 is superseded. v1 was superseded by v2 on 2026-08-26. A sunset date has not been announced yet; v1 will be deprecated as a whole before removal. Migrate with the v2 migration guide.

workspace_id
required
Workspace ID

ID of the workspace that owns the resource.

string format: uuid

ID of the workspace that owns the resource.

project_id
required
Project ID

ID of the project.

string format: uuid

ID of the project.

Idempotency-Key
string
<= 255 characters

Opaque key making a retry of this request return the first result. A 2xx response is replayed for 24 hours with Idempotent-Replayed: true. A 4xx releases the key. A 5xx, or a request still running, holds the key for 120 seconds, during which a retry gets 409; after that a retry executes again. The key covers the method, path, query, and byte-identical body it was first used with; reusing it for a different request is rejected with 422. Protection is best effort: if the key store is unavailable, or a record is lost early, a retry can execute again even after an earlier 409. See the Idempotency section of the API description.

Media typeapplication/json
CreateProductBody
object
name
required
Name

What the product is called.

string
>= 1 characters <= 255 characters
type
required
ProductType

app for a game or app published on stores, site for a website, shopify for an item in a Shopify store. Fixed once the product is created.

string
Allowed values: app site shopify
identifiers
Identifiers

The store and web identities the product is known by. An app takes apple (a numeric App Store ID), google (a Google Play package name) and steam (a numeric Steam app ID); a site takes url; a shopify product takes shopify (a product, variant or collection GID).

Array<object>
ProductIdentifierBody
object
type
required
ProductIdentifierType

The store or web identity: apple, google, steam, url or shopify.

string
Allowed values: url steam apple google shopify
identifier
required
Identifier

The ID in that store, in the form the store uses, or a URL.

string

Successful Response

Media typeapplication/json
ProductOutput
object
product_id
required
Product ID

The product’s unique identifier.

string format: uuid
project_id
required
Project ID

The project the product belongs to.

string format: uuid
name
required
Name

What the product is called.

string
type
required
ProductType

app for a game or app published on stores, site for a website, shopify for an item in a Shopify store.

string
Allowed values: app site shopify
identifiers
required
Identifiers

The store and web identities the product is known by. An app takes apple (a numeric App Store ID), google (a Google Play package name) and steam (a numeric Steam app ID); a site takes url; a shopify product takes shopify (a product, variant or collection GID).

Array<object>
ProductIdentifierBody
object
type
required
ProductIdentifierType

The store or web identity: apple, google, steam, url or shopify.

string
Allowed values: url steam apple google shopify
identifier
required
Identifier

The ID in that store, in the form the store uses, or a URL.

string
Example
{
"type": "app",
"identifiers": [
{
"type": "url"
}
]
}

Unauthenticated — missing or invalid Bearer token.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
error_code
required

Machine-readable error code: the last path segment of type.

string
field

The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.

string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description.",
"error_code": "ERROR_CODE",
"field": "tileability"
}

Forbidden — insufficient permissions, or the access token lacks the scope the operation requires.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
error_code
required

Machine-readable error code: the last path segment of type.

string
field

The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.

string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description.",
"error_code": "ERROR_CODE",
"field": "tileability"
}

Resource not found.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
error_code
required

Machine-readable error code: the last path segment of type.

string
field

The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.

string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description.",
"error_code": "ERROR_CODE",
"field": "tileability"
}

The outcome of the request with this Idempotency-Key is not known yet: it is still running, or it failed without a stored response. Retry after the number of seconds in Retry-After.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
error_code
required

Machine-readable error code: the last path segment of type.

string
field

The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.

string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description.",
"error_code": "ERROR_CODE",
"field": "tileability"
}

Invalid input parameters, or an Idempotency-Key reused for a different request.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
error_code
required

Machine-readable error code: the last path segment of type.

string
field

The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.

string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description.",
"error_code": "ERROR_CODE",
"field": "tileability"
}

Rate limited — retry after the number of seconds in Retry-After.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
error_code
required

Machine-readable error code: the last path segment of type.

string
field

The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.

string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description.",
"error_code": "ERROR_CODE",
"field": "tileability"
}

Internal server error.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
error_code
required

Machine-readable error code: the last path segment of type.

string
field

The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.

string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description.",
"error_code": "ERROR_CODE",
"field": "tileability"
}