Layers Inc. Recommendations API
Suggested actions for projects.
Suggested actions for projects.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/layers-com:layers-com-recommendations-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Layers Partner Recommendations API
version: v1
description: The Layers Partner API — one contract for programmatic access to projects, content generation, publishing, and webhooks. See https://layers.com/docs for conventions (auth, pagination, idempotency, errors). Auto-generated from the Zod schemas at `packages/shared-types/src/http/partner/**`; do not edit by hand.
contact:
name: Layers Partner Support
url: https://layers.com/docs/api/operational/status-and-support
servers:
- url: https://api.layers.com
description: Production
security:
- Bearer: []
tags:
- name: Recommendations
description: Suggested actions for projects.
paths:
/v1/projects/{projectId}/recommendations:
get:
summary: List recommendations for a project
operationId: listRecommendations
tags:
- Recommendations
parameters:
- in: path
name: projectId
schema:
$ref: '#/components/schemas/ProjectId'
required: true
- in: query
name: kind
schema:
description: Filter to one or more recommendation kinds.
anyOf:
- $ref: '#/components/schemas/RecommendationKindEnum'
- type: array
items:
$ref: '#/components/schemas/RecommendationKindEnum'
description: Filter to one or more recommendation kinds.
- in: query
name: status
schema:
description: Filter to one or more recommendation statuses.
anyOf:
- $ref: '#/components/schemas/RecommendationStatusEnum'
- type: array
items:
$ref: '#/components/schemas/RecommendationStatusEnum'
description: Filter to one or more recommendation statuses.
- in: query
name: minConfidence
schema:
description: Only return recommendations with at least this confidence score (0 to 1).
type: number
minimum: 0
maximum: 1
description: Only return recommendations with at least this confidence score (0 to 1).
- in: query
name: sort
schema:
description: Sort order for the returned recommendations.
$ref: '#/components/schemas/RecommendationSortEnum'
description: Sort order for the returned recommendations.
- in: query
name: cursor
schema:
description: Pagination cursor from a previous response's nextCursor; omit for the first page.
type: string
description: Pagination cursor from a previous response's nextCursor; omit for the first page.
- in: query
name: limit
schema:
description: Maximum number of recommendations to return per page (up to 100).
type: integer
exclusiveMinimum: 0
maximum: 100
description: Maximum number of recommendations to return per page (up to 100).
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/RecommendationListResponseSchema'
4XX:
description: Client error (see operational/errors)
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelopeSchema'
5XX:
description: Server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelopeSchema'
/v1/projects/{projectId}/recommendations/{recommendationId}:
patch:
summary: Update a recommendation
operationId: updateRecommendation
tags:
- Recommendations
parameters:
- in: path
name: projectId
schema:
$ref: '#/components/schemas/ProjectId'
required: true
- in: path
name: recommendationId
schema:
$ref: '#/components/schemas/RecommendationId'
required: true
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/RecommendationPatchRequestSchema'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/RecommendationPatchResponseSchema'
4XX:
description: Client error (see operational/errors)
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelopeSchema'
5XX:
description: Server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelopeSchema'
components:
schemas:
RecommendationSortEnum:
type: string
enum:
- confidence_desc
- created_desc
description: Order results by confidence (highest first) or creation time (newest first).
AdsContentId:
type: string
minLength: 5
maxLength: 64
pattern: ^adc_[A-Za-z0-9-]+$
RecommendationPatchResponseSchema:
type: object
properties:
recommendationId:
description: Unique identifier of the updated recommendation.
$ref: '#/components/schemas/RecommendationId'
status:
$ref: '#/components/schemas/RecommendationStatusEnum'
updatedAt:
$ref: '#/components/schemas/IsoTimestampSchema'
required:
- recommendationId
- status
- updatedAt
additionalProperties: false
ProjectId:
type: string
minLength: 5
maxLength: 64
pattern: ^prj_[A-Za-z0-9-]+$
ValuePropositionsEvidenceSchema:
type: object
properties:
valueProp:
description: The suggested value proposition to emphasize in your messaging.
type: string
uplift:
description: Estimated performance improvement from adopting this value proposition, as a fraction.
type: number
coverage:
description: Fraction of your content that currently lacks this value proposition.
type: number
additionalProperties: {}
KillSwitchScopeEnum:
type: string
enum:
- key
- organization
- global
description: Breadth of the kill switch that blocked the request.
PlatformErrorPlatformEnum:
type: string
enum:
- tiktok
- meta
- apple
- instagram
- appstore
description: Upstream platform that rejected or could not service the request.
ErrorEnvelopeSchema:
type: object
properties:
error:
description: Error payload describing why the request failed.
$ref: '#/components/schemas/ErrorBodySchemaOutput'
required:
- error
additionalProperties: false
RefreshFatiguedRecommendationSchemaOutput:
type: object
properties:
recommendationId:
description: Unique identifier for this recommendation.
$ref: '#/components/schemas/RecommendationId'
status:
$ref: '#/components/schemas/RecommendationStatusEnum'
confidence:
type: number
minimum: 0
maximum: 1
description: Confidence score for this recommendation, from 0 (low) to 1 (high).
createdAt:
$ref: '#/components/schemas/IsoTimestampSchema'
subject:
type: object
properties:
type:
$ref: '#/components/schemas/RecommendationSubjectTypeEnum'
id:
anyOf:
- $ref: '#/components/schemas/AdsContentId'
- type: string
description: The identifier of the ad this recommendation applies to.
label:
description: A human-readable name for the subject resource, for display purposes.
type: string
maxLength: 256
required:
- type
- id
additionalProperties: false
description: The ad this recommendation applies to.
rationale:
type: string
description: A human-readable explanation of why this recommendation was made.
suggestedAction:
description: The recommended API action to take in response to this recommendation.
$ref: '#/components/schemas/SuggestedActionSchema'
kind:
type: string
const: refresh_fatigued
description: Indicates an ad whose performance is declining and may need refreshing.
evidence:
description: Performance metrics supporting the refresh recommendation.
$ref: '#/components/schemas/RefreshFatiguedEvidenceSchema'
required:
- recommendationId
- status
- confidence
- createdAt
- subject
- rationale
- suggestedAction
- kind
- evidence
additionalProperties: false
ValuePropositionsRecommendationSchemaOutput:
type: object
properties:
recommendationId:
description: Unique identifier for this recommendation.
$ref: '#/components/schemas/RecommendationId'
status:
$ref: '#/components/schemas/RecommendationStatusEnum'
confidence:
type: number
minimum: 0
maximum: 1
description: Confidence score for this recommendation, from 0 (low) to 1 (high).
createdAt:
$ref: '#/components/schemas/IsoTimestampSchema'
subject:
type: object
properties:
type:
$ref: '#/components/schemas/RecommendationSubjectTypeEnum'
id:
anyOf:
- $ref: '#/components/schemas/ProjectId'
- type: string
description: The identifier of the project this recommendation applies to.
label:
description: A human-readable name for the subject resource, for display purposes.
type: string
maxLength: 256
required:
- type
- id
additionalProperties: false
description: The project this recommendation applies to.
rationale:
type: string
description: A human-readable explanation of why this recommendation was made.
suggestedAction:
description: The recommended API action to take in response to this recommendation.
$ref: '#/components/schemas/SuggestedActionSchema'
kind:
type: string
const: value_propositions
description: Indicates a value proposition worth emphasizing more in your content.
evidence:
description: Supporting data for the value-proposition recommendation.
$ref: '#/components/schemas/ValuePropositionsEvidenceSchema'
required:
- recommendationId
- status
- confidence
- createdAt
- subject
- rationale
- suggestedAction
- kind
- evidence
additionalProperties: false
RecommendationSchemaOutput:
oneOf:
- $ref: '#/components/schemas/RefreshFatiguedRecommendationSchemaOutput'
- $ref: '#/components/schemas/ValuePropositionsRecommendationSchemaOutput'
type: object
discriminator:
propertyName: kind
mapping:
refresh_fatigued: '#/components/schemas/RefreshFatiguedRecommendationSchemaOutput'
value_propositions: '#/components/schemas/ValuePropositionsRecommendationSchemaOutput'
RecommendationSubjectTypeEnum:
type: string
enum:
- ads_content
- project
- platform_post
- content_container
description: The kind of resource this recommendation applies to.
RefreshFatiguedEvidenceSchema:
type: object
properties:
cpaChange7d:
description: Change in cost per acquisition over the last 7 days, as a fraction (e.g. 0.25 = 25% increase).
type: number
impressions7d:
description: Total impressions over the last 7 days.
type: number
conversions7d:
description: Total conversions over the last 7 days.
type: number
additionalProperties: {}
ValidationIssueSchemaOutput:
type: object
properties:
path:
type: string
description: Dotted path to the request field that failed validation.
message:
type: string
description: Human-readable explanation of the validation failure.
required:
- path
- message
additionalProperties: false
RecommendationStatusEnum:
type: string
enum:
- open
- acknowledged
- dismissed
- acted_on
description: The current state of the recommendation in your review workflow.
IsoTimestampSchema:
anyOf:
- type: string
format: date-time
pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
- type: string
pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?:Z))$
description: ISO-8601 UTC timestamp with the 'Z' suffix (e.g. `2026-04-18T12:04:11Z`). Offset forms like `+00:00` are rejected with 422 VALIDATION — convert to UTC before sending. Outputs always emit `Z` so input shape matches output shape.
RecommendationListResponseSchema:
type: object
properties:
items:
type: array
items:
$ref: '#/components/schemas/RecommendationSchemaOutput'
nextCursor:
type:
- string
- 'null'
required:
- items
additionalProperties: false
RecommendationId:
type: string
minLength: 5
maxLength: 64
pattern: ^rec_[A-Za-z0-9-]+$
RecommendationKindEnum:
type: string
enum:
- value_propositions
- refresh_fatigued
description: The category of recommendation, indicating what kind of optimization it suggests.
SuggestedActionSchema:
type: object
properties:
endpoint:
type: string
format: starts_with
pattern: ^\/v1\/.*
description: The API endpoint path to call to act on this recommendation.
method:
type: string
enum:
- GET
- POST
- PATCH
- DELETE
- PUT
description: The HTTP method to use when calling the suggested endpoint.
body:
description: The request body to send with the suggested action, when applicable.
required:
- endpoint
- method
additionalProperties: false
ErrorBodySchemaOutput:
type: object
properties:
code:
$ref: '#/components/schemas/ErrorCodeEnum'
message:
type: string
description: Human-readable description of the error.
requestId:
$ref: '#/components/schemas/RequestId'
details:
description: Code-specific structured context for the error.
$ref: '#/components/schemas/ErrorDetailsSchemaOutput'
required:
- code
- message
- requestId
additionalProperties: false
ErrorCodeEnum:
type: string
enum:
- UNAUTHENTICATED
- FORBIDDEN_SCOPE
- FORBIDDEN_FENCE
- NOT_FOUND
- CONFLICT
- FEATURE_RETIRED
- VALIDATION
- APPROVAL_REQUIRED
- CONTENT_REJECTED
- RETURN_URL_NOT_ALLOWED
- KILL_SWITCH
- BILLING_EXHAUSTED
- MODERATION_BLOCKED
- CREDENTIAL_INVALID
- CIRCUIT_OPEN
- SOCIAL_ACCOUNT_NOT_PUBLISH_READY
- APP_REVOKED
- RATE_LIMITED
- INTERNAL
- PLATFORM_ERROR
- UPLOAD_INCOMPLETE
- UPLOAD_EXPIRED
- PAYLOAD_TOO_LARGE
- SCRAPE_FAILED
- UPLOAD_QUOTA_EXCEEDED
description: Stable machine-readable error code identifying what went wrong.
RecommendationPatchRequestSchema:
type: object
properties:
status:
$ref: '#/components/schemas/RecommendationStatusEnum'
note:
description: An optional note explaining the status change, for your own records.
type: string
maxLength: 1024
required:
- status
additionalProperties: false
RequestId:
type: string
minLength: 5
maxLength: 64
pattern: ^req_[A-Za-z0-9-]+$
ErrorDetailsSchemaOutput:
type: object
properties:
reason:
description: Short reason code or phrase narrowing the error.
type: string
originalRequestHash:
description: Body hash of the original idempotent request, on a CONFLICT replay.
type: string
currentRequestHash:
description: Body hash of the current request, on a CONFLICT replay.
type: string
issues:
description: Per-field validation failures, present on VALIDATION errors.
type: array
items:
$ref: '#/components/schemas/ValidationIssueSchemaOutput'
requiredScope:
description: Scope the API key lacks, present on FORBIDDEN_SCOPE errors.
type: string
scope:
description: Breadth of the kill switch that tripped.
$ref: '#/components/schemas/KillSwitchScopeEnum'
resource:
description: Exhausted billing resource, present on BILLING_EXHAUSTED errors.
type: string
platform:
description: Platform whose stored credential is invalid.
$ref: '#/components/schemas/PlatformErrorPlatformEnum'
socialAccountId:
description: Social account whose credential is invalid.
type: string
retryAfterSeconds:
description: Seconds to wait before retrying.
type: number
minimum: 0
retryAfterMs:
description: Milliseconds to wait before retrying.
anyOf:
- type: number
minimum: 0
- type: 'null'
platformCode:
description: Raw error code returned by the upstream platform.
type: string
platformMessage:
description: Raw error message returned by the upstream platform.
type: string
endpointClass:
description: Rate-limit bucket the throttled request belongs to.
type: string
stage:
description: Job stage at which the failure occurred.
type: string
flag:
description: Moderation flag that blocked the request.
type: string
safetyCategory:
description: Safety category triggered by moderation.
type: string
containerId:
description: Content container the error relates to.
type: string
approvalStatus:
description: Current approval status of the content.
type: string
additionalProperties: {}
securitySchemes:
Bearer:
type: http
scheme: bearer
description: 'Partner API key sent as `Authorization: Bearer <key>`. Issued per org; rotatable via the dashboard. This is the only accepted auth form.'