---
title: "Create a new scope"
method: POST
path: "/api/v1/scopes"
tags: ["Scopes"]
---

# Create a new scope

`POST /api/v1/scopes`

Required scope - write_scope

## Request body

- PostScopeReq
  - `name` string, required
  - `type` 'spa' | 's2s', required
  - `note` string
  - `locales` object[]
    - `locale` string, required
    - `value` string, required

## Response `201`

- object
  - `scope` ScopeDetail
    - `id` number
    - `name` string
    - `note` string
    - `type` 'spa' | 's2s'
    - `createdAt` string
    - `updatedAt` string
    - `deletedAt` string, nullable
    - `locales` object[]
      - `id` number
      - `scopeId` number
      - `locale` string
      - `value` string
      - `createdAt` string
      - `updatedAt` string
      - `deletedAt` string, nullable

## Changes

- **2024-08-25** `4f326b0821e0` — 1 breaking, 7 warning, 1 info
  - the `scope` response's property type changed from `object` to no type for status `201`
  - removed the optional property `scope/createdAt` from the response with the `201` status
  - removed the optional property `scope/deletedAt` from the response with the `201` status
  - removed the optional property `scope/id` from the response with the `201` status
  - …5 more
- **2024-08-11** `11e2773b3a1e` — 1 breaking, 8 info
  - the `scope` response's property type changed from no type to `object` for status `201`
  - added the optional property `scope/createdAt` to the response with the `201` status
  - added the optional property `scope/deletedAt` to the response with the `201` status
  - added the optional property `scope/id` to the response with the `201` status
  - …5 more

[Change history](https://skmtc.dev/valuemelody/apis/melody-auth-s2s-api/changes/api/v1/scopes/post.md)

---

[API](https://skmtc.dev/valuemelody/apis/melody-auth-s2s-api.md) · [All operations](https://skmtc.dev/valuemelody/apis/melody-auth-s2s-api/llms.txt) · [OpenAPI document](https://skmtc.dev/valuemelody/apis/melody-auth-s2s-api/revisions/ffd604cd7944?raw)
