# Rename or rebind an artifact

Rewrites the file’s front-matter (title, description, bindings) or moves it (slug) as a source commit.

## PATCH`/v1/artifacts/{ref}`

### Authorization

`Authorization`Bearer token · headerrequired

\`Authorization: Bearer <key>\` with the Space key (\`sfc\_\` prefix) of an unclaimed Space. The same key is the fragment of the claim URL and the token in the Space's \`/\_\_/<key>\` sign-in URL.

or

`Authorization`Bearer token · headerrequired

\`Authorization: Bearer <token>\` with an API key (\`sfa\_\` prefix), an OAuth access token, a session token, or a Space machine credential (\`sfm\_\` prefix).

or

`Authorization`OAuth2 access token · headerrequired

OAuth 2.0 with Spacefast scopes. People use the authorization code flow; machines use client credentials.

### Scopes:`connectors:execute`

## Path parameters

`ref`stringrequired

## Query parameters

`team`string

min length 1

## Request body

required`application/json`

Every field here lands as a source commit, so history, blame, and revert come from git.

`title`string

Replacement title. Rewrites the file's front-matter.

min length 1 · max length 255

`description`string | any

Replacement description.

`slug`string

Rename. Moves the file, so \`ref\` changes.

min length 1 · max length 128 · matches ^[a-z0-9][a-z0-9-]*$

`bindings`object

Replacement role to connection map. Rebinding is how an artifact moves between accounts.

## Responses

### 200Response for status 200

\`$schema\`string<uri>

Canonical JSON Schema URL for this response body. The server also sends it in the \`Link: rel="describedby"\` response header.

`data`objectrequired

One artifact, with its source at a commit.

`ref`stringrequired

Artifact address: \`<spaceId>:<path>\`. The only way to name an artifact.

min length 3 · max length 1024 · matches ^[^:]+:[^:].*$

`spaceId`stringrequired

Space holding the source file. Read-only projection of \`ref\`.

`path`stringrequired

Path within the space's source, e.g. \`artifacts/burndown.tsx\`. Read-only projection of \`ref\`.

`slug`stringrequired

Short name derived from the file name. Unique within its space.

`title`stringrequired

Title declared in the file's front-matter.

`description`string | anyrequired

Description declared in the file's front-matter.

`owner`stringrequired

\`personal\` when the file lives under \`artifacts/personal/<user>/\`. A visibility convention, not a storage boundary.

Allowed: `team``personal`

`bindings`objectrequired

Role name to connection id. Code writes roles, never accounts — sharing an artifact is a rebind, not a rewrite.

`commitSha`stringrequired

Commit the projection was read at. Everything here is true as of this commit.

`previewUrl`string | anyrequired

Rendered snapshot for this commit; null until one has been captured.

`updatedAt`string<date-time>required

When the commit landed.

`source`stringrequired

The file: one component named \`App\`, zero imports, everything else pre-bound in scope.

`parsedScopeNames`string[]required

Provided-scope names the source actually references. An unknown name here is why a render fails.

## Example cURL Request

```
curl -X PATCH "https://api.spacefast.com/v1/artifacts/string" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{\n  "title": "string",\n  "description": "string",\n  "slug": "string",\n  "bindings": {\n    "property1": "string",\n    "property2": "string"\n  }\n}'
```

## Example JavaScript Request

```
const response = await fetch("https://api.spacefast.com/v1/artifacts/string", {
  method: "PATCH",
  headers: {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json"
  },
  body: "{\n  \"title\": \"string\",\n  \"description\": \"string\",\n  \"slug\": \"string\",\n  \"bindings\": {\n    \"property1\": \"string\",\n    \"property2\": \"string\"\n  }\n}"
});
```

## Example Python Request

```
import requests

response = requests.patch(
    "https://api.spacefast.com/v1/artifacts/string",
    headers={
        "Authorization": "Bearer YOUR_TOKEN",
        "Content-Type": "application/json"
    },
    data="{\n  \"title\": \"string\",\n  \"description\": \"string\",\n  \"slug\": \"string\",\n  \"bindings\": {\n    \"property1\": \"string\",\n    \"property2\": \"string\"\n  }\n}",
)
```

## Responses

### 200 default

```
{
  "$schema": "http://example.com",
  "data": {
    "ref": "string",
    "spaceId": "string",
    "path": "string",
    "slug": "string",
    "title": "string",
    "description": "string",
    "owner": "team",
    "bindings": {
      "property1": "string",
      "property2": "string"
    },
    "commitSha": "string",
    "previewUrl": "string",
    "updatedAt": "2019-08-24T14:15:22Z",
    "source": "string",
    "parsedScopeNames": [
      "string"
    ]
  }
}
```

### Error Response

```
{
  "$schema": "http://example.com",
  "type": "string",
  "title": "string",
  "status": -9007199254740991,
  "detail": "string",
  "code": "string",
  "pointer": "string",
  "details": {
    "property1": null,
    "property2": null
  },
  "suggestions": [
    "string"
  ],
  "next": [
    "string"
  ],
  "requestId": "string"
}
```
