---
id: service-create
title: "Create a service"
description: "Create a service"
sidebar_label: "Create a service"
hide_title: true
hide_table_of_contents: true
api: eJztW/9v27gV/1cIYsD1Ntn5sqS7EzAMWdPDsu3SoE53B7iZS1PPFi8UqZKUU83w/z48kpIl22maooe2d/4pMkU+Pj5+3rePnSXVJRjmhFYXGU2pBbMQHFJugDmgCXVsbmk6pqPwgt4kNAPLjShxDU3pMz+TMBKX0oQaeFuBdX/XWU3Tpf8oDGQ0daaChHKtHCiHr1hZSsH99ge/WJS3pJbnUDB8cnUJNKV6+gtwRxNaGlTWCbD4VrECOrOsM0LNaUILof4Nau5ymh4ltGDvmk/Hp6cJVdpvDKoqaDpWlZQ3q80jXbICiJ4RlwMB5YSrh+THyjoyxXMqrQZQlK4mYUvCVEaUdgTeVkwSpwlKpauE2hK4mMXzTUTmtRVOoroXGRp3Q/WZNgVzNKVVJfB9X61XSrytgIgMdZoJMGSmTUdJYqA0YEE5yAizhJFXry7OaTgeXsBkl0JM1S9mNB1/HtXa6ws220LXedCcVPduwKzVXDAU3DsenrsAa9k8wKU53Y9hbH1EZgyraUKFg8I+DDsJC5C7cBchRTOYVvhZqJmOf9B0qFJC75hp/sRVxmiD9mWOyeBdM1ZJtHQU0DdIVJ9YWIBBy3p9huQ8LLOIv9d+6WvaMcEuhfuCr9GW3CGE4xrSOOoqoU4UYB0ryo4gVRVTMNuCmqmNCzXihCKFkFJY4Fpllq5WSSc2jFtVbxLKskygOCavOsafMWlhc7sX/prWAEOPbO6d3AmXb5gq7CuFumVTCROnu+D4j7BiKqRw9TY++tue4Wh/10W7mFhwOGQ33GBIRgGiqFrO3MFdrglnilgA4nJh47weGqNqly8vd7hlyZwDgwr9V5s5U+J/Hml/HR8Ovv/jzZ+epIxzXSnXDHz7tycpBk5bMg7dwU4k7g5brsvOvD9s2eGykrKUzCHIyUuwujIciI+gTy5fXn7bNxEjuQDDDM8FZ3LTnVVXlomywn1logBlhVY9m5w3o2vLtF67G0KPSBdHh4cfli7+BfVgwWQ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N72JgvrY2bbwf6uuuY9E/0VdfR7JvrXY6K/JPJ5T2VtUVl7Pn7Pxz/Ex39RxPtvky3cc6977nXPve65198Z97ryROrJLpbzB48tf4G9S/G0hSVZ5cvZs6sLIpQDE/zpcbRnvK3nkQh5f6kTWtdnOoOHiYh/XF9fkbCAcJ0hgjKvh5oH/PsdsYzpi7uHIImO5FcFecEqMzCASRv9P1Yw8c58ses3eVD4KNfGJSSvCqYGBliGCIl7OZ+8DWnLo8fQOufgfOsdZTVcTCgCfcnaulLge965HX750TDo8judu1vzXi3pE0B4ugfhHoSfF4T+YC7XGNJLbV3oQnOa0oN1ysAnwHZtvKSVkTSluXOlTQ8OWCmG3UZvyHXhs2fzjdMIUReA1P3eqbUhCvKVPE7D9sJPokl8+KHJ9v/86dobCdH8cv2j8Of7XPf+7xk9rZ4uKd5fANbR8HB4SNeFQ6/nP7u68AWatq5gqmPWHb/N7+F1uQ4/u+bG20asH5SSCe+oHkrLiLdx8w8DaIMckZiO6XI5ZRZeGbla4fDbCrBfHt8kdMGMCCzyGBvPHJhv8sdLegtoomdBmwH2ghSno53S7cCIlV9YccY5lO69c286znL1YnSNMI3/mVD4gEYNu0MXZHc0pXjPpWvoPT+2pJKpeeXDCA0yffve94kNH+j279jwrzVcLsOMa30LarWiSTyKw8/Yka9W/wdHYmfF
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"}
>
</Heading>

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



Create a service

<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,"maxLength":255,"not":{"enum":[null]},"description":"Name of the entity. Must be a non-empty string and not equal to null"},"specification_id":{"title":"Id","type":"string","format":"uuid","description":"Unique identifier for the entity represented as a UUID"},"desired_specification_id":{"anyOf":[{"title":"Id","type":"string","format":"uuid","description":"Unique identifier for the entity represented as a UUID"},{"type":"null"}],"description":"Desired unique identifier for the associated specification"},"messages":{"title":"Message","type":"array","items":{"type":"object","properties":{"level":{"type":"string","enum":["debug","info","information","warn","warning","error","fatal"],"default":"info","description":"Message severity level. Defaults to \"info\""},"message":{"type":"string","description":"The actual message content"},"timestamp":{"type":"number","description":"Timestamp of the message in milliseconds"}},"required":["message"],"additionalProperties":false,"description":"Object representing messages with severity levels"}},"linkable_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"}},"dimensions":{"title":"Dimension","type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":100,"not":{"enum":[null]},"description":"Key-value pairs representing dimensions. Each key must be a non-null string with a minimum length of 1"},"description":"Object representing dimensions with key-value pairs"},"attributes":{"default":{},"type":"object","description":"Attributes associated with the service, should be valid against the service specification attribute schema"},"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. Should be one of the specified values in the enumeration"},"status":{"type":"string","enum":["pending_create","pending","creating","updating","archiving","active","archived","failed","cancelled"],"description":"Status of the service. Should be one of the specified values in the enumeration"},"entity_nrn":{"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"},"package_revision_id":{"anyOf":[{"title":"Id","type":"string","format":"uuid","description":"Unique identifier for the entity represented as a UUID"},{"type":"null"}],"description":"The package revision the service is currently running, or `null` when it isn't running one. The agent that applies a revision records it here"},"desired_package_revision_id":{"anyOf":[{"title":"Id","type":"string","format":"uuid","description":"Unique identifier for the entity represented as a UUID"},{"type":"null"}],"description":"The package revision the service should move to. While it is set, the service's specification and its action specifications resolve against this revision instead of `package_revision_id`. When an action on the service succeeds, this revision becomes `package_revision_id` and this field is cleared. `null` when no move is pending"},"parent_service_id":{"anyOf":[{"title":"Id","type":"string","format":"uuid","description":"Unique identifier for the entity represented as a UUID"},{"type":"null"}],"description":"The parent service of this service. `null` for top-level services"}},"description":"Object representing service instances","additionalProperties":false,"title":"Service","example":{"name":"my-service","entity_nrn":"organization=1:account=1:namespace=1","specification_id":"67fac146-54cc-466d-8c52-a8234445a95f","linkable_to":["organization=1:account=1","organization=1:account=2"],"attributes":{"my_string_property":"my_string_value","my_number_property":0}},"required":["name","specification_id","entity_nrn"]}}},"description":"Object representing service instances"}}
>
  
</RequestSchema>

<StatusCodes
  id={undefined}
  label={undefined}
  responses={{"2XX":{"description":"Object representing service instances","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,"maxLength":255,"not":{"enum":[null]},"description":"Name of the entity. Must be a non-empty string and not equal to null"},"slug":{"type":"string","minLength":1,"maxLength":255,"not":{"enum":[null]},"description":"Slug of the entity. Automatically generated from \"name\""},"specification_id":{"title":"Id","type":"string","format":"uuid","description":"Unique identifier for the entity represented as a UUID"},"desired_specification_id":{"anyOf":[{"title":"Id","type":"string","format":"uuid","description":"Unique identifier for the entity represented as a UUID"},{"type":"null"}],"description":"Desired unique identifier for the associated specification"},"messages":{"title":"Message","type":"array","items":{"type":"object","properties":{"level":{"type":"string","enum":["debug","info","information","warn","warning","error","fatal"],"default":"info","description":"Message severity level. Defaults to \"info\""},"message":{"type":"string","description":"The actual message content"},"timestamp":{"type":"number","description":"Timestamp of the message in milliseconds"}},"required":["message"],"additionalProperties":false,"description":"Object representing messages with severity levels"}},"created_at":{"type":"string","format":"date"},"updated_at":{"type":"string","format":"date"},"archived_at":{"type":"string","format":"date","nullable":true,"description":"When the instance was last archived. `null` while the instance is not archived"},"status":{"type":"string","enum":["pending_create","pending","creating","updating","archiving","active","archived","failed","cancelled"],"description":"Status of the service. Should be one of the specified values in the enumeration"},"linkable_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"}},"dimensions":{"title":"Dimension","type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":100,"not":{"enum":[null]},"description":"Key-value pairs representing dimensions. Each key must be a non-null string with a minimum length of 1"},"description":"Object representing dimensions with key-value pairs"},"attributes":{"type":"object","description":"Attributes associated with the service, should be valid against the service specification attribute schema"},"entity_nrn":{"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"},"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. Should be one of the specified values in the enumeration"},"package_revision_id":{"anyOf":[{"title":"Id","type":"string","format":"uuid","description":"Unique identifier for the entity represented as a UUID"},{"type":"null"}],"description":"The package revision the service is currently running, or `null` when it isn't running one. The agent that applies a revision records it here"},"desired_package_revision_id":{"anyOf":[{"title":"Id","type":"string","format":"uuid","description":"Unique identifier for the entity represented as a UUID"},{"type":"null"}],"description":"The package revision the service should move to. While it is set, the service's specification and its action specifications resolve against this revision instead of `package_revision_id`. When an action on the service succeeds, this revision becomes `package_revision_id` and this field is cleared. `null` when no move is pending"},"parent_service_id":{"anyOf":[{"title":"Id","type":"string","format":"uuid","description":"Unique identifier for the entity represented as a UUID"},{"type":"null"}],"description":"The parent service of this service. `null` for top-level services"}},"description":"Object representing service instances","additionalProperties":false,"title":"Service","example":{"name":"my-service","entity_nrn":"organization=1:account=1:namespace=1","specification_id":"67fac146-54cc-466d-8c52-a8234445a95f","linkable_to":["organization=1:account=1","organization=1:account=2"],"attributes":{"my_string_property":"my_string_value","my_number_property":0}}}}}},"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>


      