---
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: eJztWm1v20YS/iuLxQFN7yjZDu4+HIFDodhqzo0rGaaTFFVVZUWOpG3IXWZ3aZsV+N8Ps8tXmYqcNMC1iD5ZXM7Ozs4882puqUxBMcOluIyoTzWoOx7CQqcQ8hUP7Rs/VMAMUI8attbUn9HAkdG5RyPQoeIp0lGfnltKwkjJiHQYUY8q+JCBNi9klFN/ax+5goj6RmXg0VAKA8LgK5amcbnv5DeN3LdUhxtIGP4yeQrUp3L5G4SGejRVeBHDQeNbwRJoUWmjuFhTjyZcXIFYmw31zzwqpD0IRJZQfyayOJ4XuxeasASIXBGzAQLCcJMPyY+ZNmSJtxRSDCBJTU7cEYSJiAhpCHzIWEyMJMiVFh6945ovY1gYaeXiJkbB3uAqj7nJUblOWKYUw8euHCNcJQpSBRrlEGtyV28mGgwuabKSqiNq4NQPmtxvmDm530gSMkE0ADEbrks66lFuINFt0SY3k0amWoEpMwYUCvSrVGsm+O/WQP+ZnQ7+/ff5P575LAxlJky18O13z3w0hk5ZCO3FlnXbyzqUaYvub4/0MMniOI2ZWUmVkBvQMlMhEGulZ5ObybddFTGy4aCYCjc8ZDHhEa6vOCirKNHmpUpemhaFR5kxii8zAx2djKrVRjN7ALgfqBGsWBYj8B5hLWj7SgW6WhLieLbhd8diHpEfgumEBO5ARBqLs1Lspx/9xm4iTGsZcmYgIvfcbLoClCfbQ62TrxkX2pBUyTseQVQKaPXX+PWs0kUt2bxWVo520y0f7KPd8YM4lvcQkYoDsejCe7Mo4kjE4uuWKVYs1rDLZGo1sgMV0VK1vTwrL2SduqWZUrTCoxpiCI1UHZAE5eJBjPAklcqgjmpTLaWMgYm2rewFCrsXtawOh7WEPdRPp6ctVpSJHMUOmYG1VPkXYKWz5eKLsdtrxC2+n66oP/u0EwqvphdZsgRFWyuVrjtEGKwfJ4FXkA+s1YnsQQ46AROY62o4FJXtt607RpCCiECEe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fJ0V9mcnTsmb+inrlnUPhXHAx+HZPA/TO+r2iod5zyHKc8f7IpT2HT7T/7pivf2wRgwdwBKCgllSZRZmcDo+tLwoUBVYW0T5m0lKAdI8fDHZlhJtPnMoJ+LbRl/+/t7TVxG0goI4wbkZVDrF0dZU/ESrrLrs4cvTMbu8vxc1pZgQIMRhh7yiK6dAfk7Q45yDzYSGU8sskSJgYKWIQYK8+ykRTPrCp0RAVozdZPkPoCDOMxRCWvcl/Z7dmOqY4oxNrswfTEqM+GQaeDbGxX6aW5yNyB8F9HEB5B+P8Fob2Y2Uj8Mi+V2rh52Yb69KT3Qz3MUaDuAOcHsy3NVEx9ujEm1f7JCUv5sF2DDEOZUBxsV3NvO/FxsGpPv2uNIiNbqiIZlkiWiHrlj++rAv2Ht7dWZYjtm+Zzv/Ex5x9zfv9/drhY2X4Jkesc7Gx4OjylTR3ZmdKOri9RNPSIhIkWoA5+fdrx4m0TlA/vLG+M8eAkjRm3wcw62Lb0yVn/x7MIxA36rj+j2+2SaXit4qLA5Q8Z4JBrNkd9KI52tf9s8ugGmAXXbEvfQ47yOUkHOMCphpkIgN1Ugp2z2zEKsd/5KO28FV6up8EtunL5XW5iUwBV7B6DFrunPkVnS+s20a5taczEOrOBlzqeFqbduLETJ9rTBwfgSsLt1lHcyvcgioJ65VUMPmMTXxT/A84QspA=
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}},"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"}},"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>


      