---
id: service-specification-create
title: "Create a service specification"
description: "Create a service specification"
sidebar_label: "Create a service specification"
hide_title: true
hide_table_of_contents: true
api: eJztWm1vG7kR/isEUaC5diU7QfuhKopCcXQ5X3y2YTnJoTrVpnZHWl645IbkWtkK+u/FkNw3eRUlaYDrIfokiTscDmeeedVuqMpBM8uVPE/oiBrQDzyGO5NDzJc8dk9GsQZmgUbUspWhoxmdejI6j2gCJtY8Rzo6omeOkjASGJEOIxpRDe8LMPa5Sko62rifXENCR1YXENFYSQvS4iOW5yLsO/nVIPcNNXEKGcNvtsyBjqha/AqxpRHNNV7EcjD4VLIMWlTGai5XNKIZlxcgVzalo6cRlcodBLLI6GgmCyHm290LXbIMiFoSmwIBabkth+SnwliywFtKJQeQ5bYk/gjCZEKksgTeF0wQqwhypduIPnDDFwLurHJycStQsDe4ygW3JSrXC8u0ZvizK8cYV4mGXINBOeSKPNSbiQGLS4Ysle6IOvXqB0PWKbMn61SRmEliAIhNuQl0NKLcQmbaol3eXDYy1QrMmbWgUaB/K71ikv/HGegfs9PB3/40//OTEYtjVUhbLXz3zycjNIbJWQztxZZ128smVnmL7g+P9HBZCJELZpdKZ+QGjCp0DMRZ6cnlzeV3XRUxknLQTMcpj5kgPMH1JQftFCXbvHTgZeh2G1FmreaLwkJHJ+NqtdHMHgDuB2oCS1YIBN4jrE3bvlKBrpaEeJ5t+D0wwRPy4/Tqkkz9gYg0Joog9qcf/cZtIswYFXNmISFrbtOuAOFkd6hz8hXj0liSa/XAE0iCgE5/jV/PKl3Uks1rZZVoN9PywT7aHT8QQq0hIRUH4tCF92ZJwpGIieuWKZZMGNhlcuU0sgMV2VK1uzwLF3JO3dJMEG0bUQMCYqt0ByTTsHgQIzzLlbaoo9pUC6UEMNm2lbvA1u1FLevDYS1jH+pfp6ctVpTJEsWOmYWV0uVXYGWKxd1XY7fXiBt8frWko9nnnbCNanpZZAvQtLVS6bpDhMH6cRJ4BeXAWZ2oHuSgEzCJua6Gw7ay/aZ1xwRykAnIuOw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DgjtlRSV+dEsqPbif7qQOUrLzzzn5XJZeemipCMl9Y95GFkrtV5p/utoY9x8zb1d12d4PDRgcA8+3/hFrXxcWFxikIppIFMA16XGAHMZtv53i8yZU0Xi/Pfv7ZFwJf7CRfacIV4nJwqvOkpww9kGUkf1/A7kikmR011wHsfgkjmJdQX/9/wzUjitXXkWgqilVvOB2ScScfNfWaK8t+cVr5hbr22pWnyR2zH02dWAq7UtMVxZ9MfhwkHgeJx0HicZB4HCR+Y4PE48TwdzMxPM5KvqlZyaMB8e9xIPxtTID3z3a/qWHucbp3nO4dp3vH6d5vPt3bujLrL31Tte9dFHLu1AEoaK20IUnhZkLj63PCpQVdpbLPmbAF0E6Q4+FO3DJbmDOVQL8W2rL/cHt7TfwGEqsE80Xi5AhBwN3BdVBddnUI7p3VuV2en9fKEjRghMCcE5qn4A7I2x9ykPk0VdpGJC0yJgcaWIIYC2e5DIpnVp0ZogKMYatPkPoFWMYFJIFX2Be6fNcp1xGFOJt9sD0x6oth0JkcNLar9NJcZO5B+NcjCI8g/G1B6C5mU4Vv4ubKWD8nTemInvS+mIs5CvQD4NxotqGFFnREU2tzMzo5YTkftmvPYawyin9oVP93uEmfh1X7X49ao8jItShIhqWxI6JR+PJ9VSX++PbWqQyxfdO83js55vxjzu//R4/LpeuTEbnewZ4OT4entKkjO9P58fW5a1qUsRmTLUAdfNu848WbJigf3hlujPHgJBeMu2DmHGwTfHLW/7I8AjFF3x3N6GazYAZea7Hd4vL7AnC4OZujPjT3LdUM1ZMCc+Cabeg7KFE+L+kAB3fVEBsBsJtKcGLid4xj7HM/SjtvhZfrq+ktunJ4Dz9zKYBqtsagxdZ0RNHZ8no84NY2VDC5KlzgpZ6ng2k3buzEifbUyQO4knCz8RS36h3I7ZZG4SoWf+PwZrv9L8r7Hmg=
sidebar_class_name: "post api-method"
info_path: docs/api/nullplatform-api
custom_edit_url: null
---

import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint";
import ParamsDetails from "@theme/ParamsDetails";
import RequestSchema from "@theme/RequestSchema";
import StatusCodes from "@theme/StatusCodes";
import OperationTabs from "@theme/OperationTabs";
import TabItem from "@theme/TabItem";
import Heading from "@theme/Heading";

<Heading
  as={"h1"}
  className={"openapi__heading"}
  children={"Create a service specification"}
>
</Heading>

<MethodEndpoint
  method={"post"}
  path={"/service_specification"}
  context={"endpoint"}
>
  
</MethodEndpoint>



Create a service specification

<Heading
  id={"request"}
  as={"h2"}
  className={"openapi-tabs__heading"}
  children={"Request"}
>
</Heading>

<ParamsDetails
  parameters={undefined}
>
  
</ParamsDetails>

<RequestSchema
  title={"Body"}
  body={{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"not":{"enum":[null]},"description":"Name of the entity. Must be a non-empty string and not equal to null"},"visible_to":{"title":"Visibility","type":"array","description":"Array representing visibility settings for the entity. Specifies what/who can see this entity","items":{"title":"NRN","type":"string","pattern":"^organization=[0-9*]+(:account=[0-9*]+)?(:namespace=[0-9*]+)?(:application=[0-9*]+)?(:scope=[0-9*]+)?$","description":"Nullplatform Resource Name (NRN) representing a hierarchical identifier for nullplatform resources"}},"attributes":{"title":"Attribute","type":"object","properties":{"schema":{"type":"object","default":{},"description":"Specification of the attribute schema. Must be a valid JSON Schema"},"values":{"type":"object","default":{},"description":"Values associated with the attribute. Must validate against provided schema"}},"required":["schema","values"],"propertyNames":{"enum":["schema","values"],"description":"Allowed property names"},"additionalProperties":false,"description":"Object representing an attribute with a schema and associated values"},"selectors":{"title":"Selector","type":"object","properties":{"imported":{"type":"boolean","default":false},"provider":{"type":"string","minLength":1,"maxLength":100,"default":"any"},"category":{"type":"string","minLength":1,"maxLength":100,"default":"any"},"sub_category":{"type":"string","minLength":1,"maxLength":100,"default":"any"}},"additionalProperties":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"number"},{"type":"boolean"},{"type":"null"}]},"description":"Key-value object representing instance selectors"},"type":{"default":"dependency","type":"string","enum":["dependency","scope"],"description":"Type of the service specification. Should be one of the specified values in the enumeration"},"dimensions":{"title":"Specification Dimension","type":"object","properties":{},"additionalProperties":{"type":"object","properties":{"required":{"type":"boolean"},"values":{"type":"array","items":{"type":"string"}}},"additionalProperties":false,"required":["required"]}},"assignable_to":{"default":"any","type":"string","enum":["any","dimension","scope"],"description":"Specifies if the service can be assigned to any entity, only dimensions, or only scopes."},"use_default_actions":{"default":true,"type":"boolean","description":"Specifies if the service specification should autogenerate its create, update, and delete actions from the attributes schema. When omitted on create, the default is true for every type except `scope`. An explicitly sent value always wins"},"use_default_naming":{"default":true,"type":"boolean","description":"When true, the instance name is optional and generated by nullplatform or taken from the schema's `name` property. When false, a caller-provided name is required. Defaults to true for new specifications"},"scopes":{"title":"Specification Scope","type":"object","properties":{"provider":{"type":"object","properties":{"values":{"type":"array","items":{"oneOf":[{"type":"string","enum":["AWS:SERVERLESS:LAMBDA","AWS:WEB_POOL:EC2INSTANCES","AWS:WEB_POOL:EKS","AZURE:WEB_POOL:AKS","GOOGLE:WEB_POOL:GKE","OCI:WEB_POOL:OKE"]},{"type":"string","format":"uuid","description":"UUID of a scope specification"}]},"minItems":1}},"additionalProperties":false,"required":["values"]}},"additionalProperties":false},"package_id":{"type":"string","format":"uuid","nullable":true,"description":"The package that owns this service specification. Set automatically when a package revision that includes the specification is published; a specification belongs to at most one package. `PATCH` can point it at another package or clear it with `null` to release the claim, for example after deleting the package. The change is refused while any instance of the specification is bound to a package revision, current or desired"}},"description":"Object representing service specifications","additionalProperties":false,"title":"ServiceSpecification","example":{"name":"my-service-specification","visible_to":["organization=1:account=1","organization=1:account=2"],"dimensions":{"environment":{"required":true,"values":["production","staging"]}},"scopes":{"provider":{"values":["AWS:SERVERLESS:LAMBDA","AWS:WEB_POOL:EC2INSTANCES","uuid-of-a-specific-scope-specification"]}},"assignable_to":"any","attributes":{"schema":{"type":"object","properties":{"my_string_property":{"type":"string"},"my_number_property":{"type":"number","default":0}},"required":["my_string_property"]},"values":{}}},"required":["name","visible_to"]}}},"description":"Object representing service specifications"}}
>
  
</RequestSchema>

<StatusCodes
  id={undefined}
  label={undefined}
  responses={{"2XX":{"description":"Object representing service specifications","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"title":"Id","type":"string","format":"uuid","description":"Unique identifier for the entity represented as a UUID"},"name":{"type":"string","minLength":1,"not":{"enum":[null]},"description":"Name of the entity. Must be a non-empty string and not equal to null"},"slug":{"type":"string","minLength":1,"not":{"enum":[null]},"description":"Slug of the specification. Automatically generated from \"name\""},"created_at":{"type":"string","format":"date"},"updated_at":{"type":"string","format":"date"},"visible_to":{"title":"Visibility","type":"array","description":"Array representing visibility settings for the entity. Specifies what/who can see this entity","items":{"title":"NRN","type":"string","pattern":"^organization=[0-9*]+(:account=[0-9*]+)?(:namespace=[0-9*]+)?(:application=[0-9*]+)?(:scope=[0-9*]+)?$","description":"Nullplatform Resource Name (NRN) representing a hierarchical identifier for nullplatform resources"}},"attributes":{"title":"Attribute","type":"object","properties":{"schema":{"type":"object","default":{},"description":"Specification of the attribute schema. Must be a valid JSON Schema"},"values":{"type":"object","default":{},"description":"Values associated with the attribute. Must validate against provided schema"}},"required":["schema","values"],"propertyNames":{"enum":["schema","values"],"description":"Allowed property names"},"additionalProperties":false,"description":"Object representing an attribute with a schema and associated values"},"selectors":{"title":"Selector","type":"object","properties":{"imported":{"type":"boolean","default":false},"provider":{"type":"string","minLength":1,"maxLength":100,"default":"any"},"category":{"type":"string","minLength":1,"maxLength":100,"default":"any"},"sub_category":{"type":"string","minLength":1,"maxLength":100,"default":"any"}},"additionalProperties":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"number"},{"type":"boolean"},{"type":"null"}]},"description":"Key-value object representing instance selectors"},"type":{"type":"string","enum":["dependency","scope"],"description":"Type of the service specification. Should be one of the specified values in the enumeration"},"dimensions":{"title":"Specification Dimension","type":"object","properties":{},"additionalProperties":{"type":"object","properties":{"required":{"type":"boolean"},"values":{"type":"array","items":{"type":"string"}}},"additionalProperties":false,"required":["required"]}},"scopes":{"title":"Specification Scope","type":"object","properties":{"provider":{"type":"object","properties":{"values":{"type":"array","items":{"oneOf":[{"type":"string","enum":["AWS:SERVERLESS:LAMBDA","AWS:WEB_POOL:EC2INSTANCES","AWS:WEB_POOL:EKS","AZURE:WEB_POOL:AKS","GOOGLE:WEB_POOL:GKE","OCI:WEB_POOL:OKE"]},{"type":"string","format":"uuid","description":"UUID of a scope specification"}]},"minItems":1}},"additionalProperties":false,"required":["values"]}},"additionalProperties":false},"assignable_to":{"type":"string","enum":["any","dimension","scope"],"description":"Specifies if the service can be assigned to any entity, only dimensions, or only scopes."},"use_default_actions":{"type":"boolean","description":"Specifies if the service specification should autogenerate its create, update, and delete actions from the attributes schema. When omitted on create, the default is true for every type except `scope`"},"use_default_naming":{"type":"boolean","description":"When true, the instance name is optional and generated by nullplatform or taken from the schema's `name` property. When false, a caller-provided name is required. Defaults to true for new specifications"},"package_id":{"type":"string","format":"uuid","nullable":true,"description":"The package that owns this service specification. Set automatically when a package revision that includes the specification is published; a specification belongs to at most one package. `PATCH` can point it at another package or clear it with `null` to release the claim, for example after deleting the package. The change is refused while any instance of the specification is bound to a package revision, current or desired"}},"description":"Object representing service specifications","additionalProperties":false,"title":"ServiceSpecification","example":{"name":"my-service-specification","visible_to":["organization=1:account=1","organization=1:account=2"],"dimensions":{"environment":{"required":true,"values":["production","staging"]}},"scopes":{"provider":{"values":["AWS:SERVERLESS:LAMBDA","AWS:WEB_POOL:EC2INSTANCES","uuid-of-a-specific-scope-specification"]}},"assignable_to":"any","attributes":{"schema":{"type":"object","properties":{"my_string_property":{"type":"string"},"my_number_property":{"type":"number","default":0}},"required":["my_string_property"]},"values":{}}}}}}},"4XX":{"description":"Format for representing errors during API interactions","content":{"application/json":{"schema":{"title":"Error","type":"object","properties":{"statusCode":{"type":"number","description":"HTTP status code indicating the error"},"code":{"type":"string","description":"Unique error code for reference and categorization"},"error":{"type":"string","description":"Short, human-readable error type or category"},"message":{"type":"string","description":"Detailed error message providing additional context"}},"description":"Format for representing errors during API interactions","required":["statusCode","error","message"]}}}},"5XX":{"description":"Format for representing errors during API interactions","content":{"application/json":{"schema":{"title":"Error","type":"object","properties":{"statusCode":{"type":"number","description":"HTTP status code indicating the error"},"code":{"type":"string","description":"Unique error code for reference and categorization"},"error":{"type":"string","description":"Short, human-readable error type or category"},"message":{"type":"string","description":"Detailed error message providing additional context"}},"description":"Format for representing errors during API interactions","required":["statusCode","error","message"]}}}}}}
>
  
</StatusCodes>


      