---
id: core-users-service-account-create
title: "core_users_service_account_create"
description: "Create a new user account that is marked as a service account"
sidebar_label: "core_users_service_account_create"
hide_title: true
hide_table_of_contents: true
api: eJytVk1v2zgQ/SsEz4rlOO2261O7RbAw0O4GTbqHLQJjLI0l1hKpJSk3hqH/vjOkHMmOkx7aS6CQ8/HmzZuh99I0aMEroxe5nMvMWFy2Dq1b0p+tynAJWWZa7ZeZRfAoE5mjy6xq2Ic8PoRjAULjd8GeoncQvgQvlBM12A3mAhwZ9UEPNhTNQ+Hk/GvILO8TafG/Fp3/w+Q7Od/TsfZIhvQJTVOpLGBNvzlOvpcuK7EG/vK7BgmOWX3DjOM2livzCh3faqhxZOW8Vbogq1rpj6gLX8r5ZZfIWOOysKZtRuYrYyoEHWpfQ1sRnDVUDskDHxoVYr1o7W37aBwBnQJZG1sDWcqcAFx4VT9lerEW2nhBhW1VjnkitlCpXJCnuPptKnLYOdl1kUFKkzOroW5i1Stfcb4v1IDb2IP3sQWfI9/keeTaI3aYtVZ5asVXakDrS+qF2tB/913olWuMdrGi2XT6CxvGSjrfNELlzQb12Rt2W7Yqf/6y2YzuFGEt0PJl6Pnx7cHzhNOYfQg3ypoMuH9AeiQusn7cZgbz6ie5PI74D+skuIpra419Oh1GL9cKq3yJfD8WKFgLO3JQHuszwmX4mcnPtYluIM8Vp4XqZpyvG6gZoEVkz/Jx9Qv5+BM1WpWJ9zeLZwjJ0YOqzoro+WrHGukDjETQJ32hTDqq0ZeG93BjXJgJ4M0kU16OaVjL6claTiUPqd0id41mtLUVO0Cj0u1VKnlKDzN8y/TE+kaT/FhJ6X3DwYIVrzEEy6NBsJjgz8Nevn6Auqlw2KvDGjteoGFJjnckb5XRGqSdMXt1MX1zMfv97vL1/PXlfPZ2Mn1z+S8TrfTaBHg9gQPmRHK5kTaOMHk7mT1p8ifYUEpx8IpSEU4x8gkjJS1BFrREouFmyxKryrwrzGOmiTKMhISGPKxDvZ8WdzzrgWvmzc3TtFC+bFeTzNTpKEQ6fK0qs0oplU4/Lj5c/3V7HbjlTtegR8G52eEldafPpTj/Bo8G4+ef4ygGjw8+bSoCGxanDbMQ1dg/1XHVuV5+I0XSCeu+ZAWT8X6/AodfbNV1fEwisvya0OcWrIIV95ZeE3JAyElvLOIN7riUWNTFHUNi86oNOjid/C45eNB2xca/aHs/GrKbv2+5jav+p0YdJlta+E6H/JeGMqHfR+wdpiac7WUFumihYNsYM6y6lrkZfgPE4UkOH1zVYaPq3Qgh0RMs7vhRIYqSvpT4yHT3FPx/PeJWNQ==
sidebar_class_name: "post api-method"
info_path: docs/developer-docs/api/reference/authentik
custom_edit_url: null
hide_send_button: true
---

import ApiTabs from "@theme/ApiTabs";
import DiscriminatorTabs from "@theme/DiscriminatorTabs";
import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint";
import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes";
import MimeTabs from "@theme/MimeTabs";
import ParamsItem from "@theme/ParamsItem";
import ResponseSamples from "@theme/ResponseSamples";
import SchemaItem from "@theme/SchemaItem";
import SchemaTabs from "@theme/SchemaTabs";
import Heading from "@theme/Heading";
import OperationTabs from "@theme/OperationTabs";
import TabItem from "@theme/TabItem";

<Heading
  as={"h1"}
  className={"openapi__heading"}
  children={"core_users_service_account_create"}
>
</Heading>

<MethodEndpoint
  method={"post"}
  path={"/core/users/service_account/"}
>
  
</MethodEndpoint>



Create a new user account that is marked as a service account

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

<MimeTabs
  className={"openapi-tabs__mime"}
>
  <TabItem
    label={"application/json"}
    value={"application/json-schema"}
  >
    <details
      style={{}}
      className={"openapi-markdown__details mime"}
      data-collapsed={false}
      open={true}
    >
      <summary
        style={{}}
        className={"openapi-markdown__details-summary-mime"}
      >
        <h3
          className={"openapi-markdown__details-summary-header-body"}
        >
          Body
        </h3><strong
          className={"openapi-schema__required"}
        >
          required
        </strong>
      </summary><div
        style={{"textAlign":"left","marginLeft":"1rem"}}
      >
        
      </div><ul
        style={{"marginLeft":"1rem"}}
      >
        <SchemaItem
          collapsible={false}
          name={"name"}
          required={true}
          schemaName={"string"}
          qualifierMessage={"**Possible values:** `non-empty`"}
          schema={{"type":"string","minLength":1}}
        >
          
        </SchemaItem><SchemaItem
          collapsible={false}
          name={"create_group"}
          required={false}
          schemaName={"boolean"}
          qualifierMessage={undefined}
          schema={{"type":"boolean","default":false}}
        >
          
        </SchemaItem><SchemaItem
          collapsible={false}
          name={"expiring"}
          required={false}
          schemaName={"boolean"}
          qualifierMessage={undefined}
          schema={{"type":"boolean","default":true}}
        >
          
        </SchemaItem><SchemaItem
          collapsible={false}
          name={"expires"}
          required={false}
          schemaName={"date-time"}
          qualifierMessage={undefined}
          schema={{"type":"string","format":"date-time","description":"If not provided, valid for 360 days"}}
        >
          
        </SchemaItem>
      </ul>
    </details>
  </TabItem>
</MimeTabs><div>
  <div>
    <ApiTabs
      label={undefined}
      id={undefined}
    >
      <TabItem
        label={"200"}
        value={"200"}
      >
        <div>
          
          
          
          
          
        </div><div>
          <MimeTabs
            className={"openapi-tabs__mime"}
            schemaType={"response"}
          >
            <TabItem
              label={"application/json"}
              value={"application/json"}
            >
              <SchemaTabs
                className={"openapi-tabs__schema"}
              >
                <TabItem
                  label={"Schema"}
                  value={"Schema"}
                >
                  <details
                    style={{}}
                    className={"openapi-markdown__details response"}
                    data-collapsed={false}
                    open={true}
                  >
                    <summary
                      style={{}}
                      className={"openapi-markdown__details-summary-response"}
                    >
                      <strong>
                        Schema
                      </strong>
                    </summary><div
                      style={{"textAlign":"left","marginLeft":"1rem"}}
                    >
                      
                    </div><ul
                      style={{"marginLeft":"1rem"}}
                    >
                      <SchemaItem
                        collapsible={false}
                        name={"username"}
                        required={true}
                        schemaName={"string"}
                        qualifierMessage={undefined}
                        schema={{"type":"string"}}
                      >
                        
                      </SchemaItem><SchemaItem
                        collapsible={false}
                        name={"token"}
                        required={true}
                        schemaName={"string"}
                        qualifierMessage={undefined}
                        schema={{"type":"string"}}
                      >
                        
                      </SchemaItem><SchemaItem
                        collapsible={false}
                        name={"user_uid"}
                        required={true}
                        schemaName={"string"}
                        qualifierMessage={undefined}
                        schema={{"type":"string"}}
                      >
                        
                      </SchemaItem><SchemaItem
                        collapsible={false}
                        name={"user_pk"}
                        required={true}
                        schemaName={"integer"}
                        qualifierMessage={undefined}
                        schema={{"type":"integer"}}
                      >
                        
                      </SchemaItem><SchemaItem
                        collapsible={false}
                        name={"group_pk"}
                        required={false}
                        schemaName={"string"}
                        qualifierMessage={undefined}
                        schema={{"type":"string"}}
                      >
                        
                      </SchemaItem>
                    </ul>
                  </details>
                </TabItem><TabItem
                  label={"Example (from schema)"}
                  value={"Example (from schema)"}
                >
                  <ResponseSamples
                    responseExample={"{\n  \"username\": \"string\",\n  \"token\": \"string\",\n  \"user_uid\": \"string\",\n  \"user_pk\": 0,\n  \"group_pk\": \"string\"\n}"}
                    language={"json"}
                  >
                    
                  </ResponseSamples>
                </TabItem>
              </SchemaTabs>
            </TabItem>
          </MimeTabs>
        </div>
      </TabItem><TabItem
        label={"400"}
        value={"400"}
      >
        <div>
          
          
          
          
          
        </div><div>
          <MimeTabs
            className={"openapi-tabs__mime"}
            schemaType={"response"}
          >
            <TabItem
              label={"application/json"}
              value={"application/json"}
            >
              <SchemaTabs
                className={"openapi-tabs__schema"}
              >
                <TabItem
                  label={"Schema"}
                  value={"Schema"}
                >
                  <details
                    style={{}}
                    className={"openapi-markdown__details response"}
                    data-collapsed={false}
                    open={true}
                  >
                    <summary
                      style={{}}
                      className={"openapi-markdown__details-summary-response"}
                    >
                      <strong>
                        Schema
                      </strong>
                    </summary><div
                      style={{"textAlign":"left","marginLeft":"1rem"}}
                    >
                      
                    </div><ul
                      style={{"marginLeft":"1rem"}}
                    >
                      <SchemaItem
                        collapsible={false}
                        name={"non_field_errors"}
                        required={false}
                        schemaName={"string[]"}
                        qualifierMessage={undefined}
                        schema={{"type":"array","items":{"type":"string"}}}
                      >
                        
                      </SchemaItem><SchemaItem
                        collapsible={false}
                        name={"code"}
                        required={false}
                        schemaName={"string"}
                        qualifierMessage={undefined}
                        schema={{"type":"string"}}
                      >
                        
                      </SchemaItem><SchemaItem
                        name={"property name*"}
                        required={false}
                        schemaName={"any"}
                        qualifierMessage={undefined}
                        schema={{"type":"object","description":"Validation Error","properties":{"non_field_errors":{"type":"array","items":{"type":"string"}},"code":{"type":"string"}},"additionalProperties":{},"title":"ValidationError"}}
                        collapsible={false}
                        discriminator={false}
                      >
                        
                      </SchemaItem>
                    </ul>
                  </details>
                </TabItem><TabItem
                  label={"Example (from schema)"}
                  value={"Example (from schema)"}
                >
                  <ResponseSamples
                    responseExample={"{\n  \"non_field_errors\": [\n    \"string\"\n  ],\n  \"code\": \"string\"\n}"}
                    language={"json"}
                  >
                    
                  </ResponseSamples>
                </TabItem>
              </SchemaTabs>
            </TabItem>
          </MimeTabs>
        </div>
      </TabItem><TabItem
        label={"403"}
        value={"403"}
      >
        <div>
          
          
          
          
          
        </div><div>
          <MimeTabs
            className={"openapi-tabs__mime"}
            schemaType={"response"}
          >
            <TabItem
              label={"application/json"}
              value={"application/json"}
            >
              <SchemaTabs
                className={"openapi-tabs__schema"}
              >
                <TabItem
                  label={"Schema"}
                  value={"Schema"}
                >
                  <details
                    style={{}}
                    className={"openapi-markdown__details response"}
                    data-collapsed={false}
                    open={true}
                  >
                    <summary
                      style={{}}
                      className={"openapi-markdown__details-summary-response"}
                    >
                      <strong>
                        Schema
                      </strong>
                    </summary><div
                      style={{"textAlign":"left","marginLeft":"1rem"}}
                    >
                      
                    </div><ul
                      style={{"marginLeft":"1rem"}}
                    >
                      <SchemaItem
                        collapsible={false}
                        name={"detail"}
                        required={true}
                        schemaName={"string"}
                        qualifierMessage={undefined}
                        schema={{"type":"string"}}
                      >
                        
                      </SchemaItem><SchemaItem
                        collapsible={false}
                        name={"code"}
                        required={false}
                        schemaName={"string"}
                        qualifierMessage={undefined}
                        schema={{"type":"string"}}
                      >
                        
                      </SchemaItem>
                    </ul>
                  </details>
                </TabItem><TabItem
                  label={"Example (from schema)"}
                  value={"Example (from schema)"}
                >
                  <ResponseSamples
                    responseExample={"{\n  \"detail\": \"string\",\n  \"code\": \"string\"\n}"}
                    language={"json"}
                  >
                    
                  </ResponseSamples>
                </TabItem>
              </SchemaTabs>
            </TabItem>
          </MimeTabs>
        </div>
      </TabItem>
    </ApiTabs>
  </div>
</div>
      