---
title: "Create"
method: POST
path: "/api/v1/directories"
tags: ["Directory"]
---

# Create

`POST /api/v1/directories`

Create a directory.

## Request body

- C1ApiDirectoryV1DirectoryServiceCreateRequest — Uplevel an app into a full directory. This message contains a oneof named account_filter. Only a single field of the following list may be set at a time: - all - celExpression
  - `all` C1ApiDirectoryV1DirectoryAccountFilterAll, nullable — The DirectoryAccountFilterAll message.
  - `appId` string — The AppID to make into a directory, providing identities and more for the C1 app.
  - `celExpression` C1ApiDirectoryV1DirectoryAccountFilterCel, nullable — The DirectoryAccountFilterCel message.
    - `expression` string — The expression field.
  - `expandMask` C1ApiDirectoryV1DirectoryExpandMask — The fields to be included in the directory response.
    - `paths` string[], nullable — An array of fields to be included in the directory response.
  - `mergeConfig` C1ApiDirectoryV1DirectoryMergeConfig — DirectoryMergeConfig configures how AppUsers from this directory are matched to C1 Users.
    - `matchCases` C1ApiDirectoryV1DirectoryMergeMatchCase[], nullable — Ordered list of match cases evaluated in sequence. First match wins.
      - `appUserKeyCel` string — CEL expression evaluated against an AppUser to produce match key(s).
      - `userKeyCel` string — CEL expression evaluated against a User to produce match key(s).

## Response `200`

The DirectoryServiceCreateResponse message.

- C1ApiDirectoryV1DirectoryServiceCreateResponse — The DirectoryServiceCreateResponse message.
  - `directoryView` C1ApiDirectoryV1DirectoryView — The directory view contains a directory and an app_path which is a JSONPATH set to the location in the expand mask that the expanded app will live if requested by the expander.
    - `appPath` string — JSONPATH expression indicating the location of the App object in the array.
    - `directory` C1ApiDirectoryV1Directory — This object indicates that an app is also a directory. This message contains a oneof named account_filter. Only a single field of the following list may be set at a time: - all - celExpression
      - `all` C1ApiDirectoryV1DirectoryAccountFilterAll, nullable — The DirectoryAccountFilterAll message.
      - `appId` string — The ID of the app associated with the directory.
      - `celExpression` C1ApiDirectoryV1DirectoryAccountFilterCel, nullable — The DirectoryAccountFilterCel message.
        - `expression` string — The expression field.
      - `createdAt` string, date-time
      - `deletedAt` string, date-time
      - `mergeConfig` C1ApiDirectoryV1DirectoryMergeConfig — DirectoryMergeConfig configures how AppUsers from this directory are matched to C1 Users.
        - `matchCases` C1ApiDirectoryV1DirectoryMergeMatchCase[], nullable — Ordered list of match cases evaluated in sequence. First match wins.
          - `appUserKeyCel` string — CEL expression evaluated against an AppUser to produce match key(s).
          - `userKeyCel` string — CEL expression evaluated against a User to produce match key(s).
      - `updatedAt` string, date-time
  - `expanded` object[], nullable — List of serialized related objects.
    - `@type` string — The type of the serialized message.

---

[API](https://skmtc.net/conductorone/apis/c1-api.md) · [All operations](https://skmtc.net/conductorone/apis/c1-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/conductorone/c1-api/revisions/d391405a35d3/schema)
