---
title: "Op Create"
method: POST
path: "/v2/{entity}/{project}/ops"
tags: ["Ops"]
---

# Op Create

`POST /v2/{entity}/{project}/ops`

Create an op object.

## Path parameters

- `entity` string, required
- `project` string, required

## Request body

- OpCreateBody — Request body for creating an Op object via REST API. This model excludes project_id since it comes from the URL path in RESTful endpoints.
  - `name` string, nullable — The name of this op. Ops with the same name will be versioned together.
  - `source_code` string, nullable — Complete source code for this op, including imports

## Response `200`

Successful Response

- OpCreateRes — Response model for creating an Op object.
  - `digest` string, required — The digest of the created op
  - `object_id` string, required — The ID of the created op
  - `version_index` integer, required — The version index of the created op

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/wandb/apis/fastapi.md) · [All operations](https://skmtc.net/wandb/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/wandb/fastapi/revisions/56745769989b/schema)
