Assign Project to Chat

Assign a project to a chat

POST
/projects/{projectId}/assign
Authorization<token>

Your v0 API key. Get one at https://v0.dev/chat/settings/keys

In: header

Path Parameters

projectIdstring

Path parameter "projectId"

chatIdstring

Response Body

curl -X POST "https://api.v0.dev/v1/projects/string/assign" \
  -H "Content-Type: application/json" \
  -d '{
    "chatId": "string"
  }'
{
  "object": "project",
  "id": "string",
  "assigned": true
}
{
  "error": {
    "message": "string",
    "type": "unauthorized_error"
  }
}
{
  "error": {
    "message": "string",
    "type": "forbidden_error"
  }
}
{
  "error": {
    "message": "string",
    "type": "not_found_error"
  }
}
{
  "error": {
    "message": "string",
    "type": "conflict_error"
  }
}
{
  "error": {
    "message": "string",
    "type": "payload_too_large_error"
  }
}
{
  "error": {
    "message": "string",
    "type": "unprocessable_entity_error"
  }
}
{
  "error": {
    "message": "string",
    "type": "too_many_requests_error"
  }
}
{
  "error": {
    "message": "string",
    "type": "internal_server_error"
  }
}

Code Examples

cURL

Assign Chat to Project
curl -X POST "https://api.v0.dev/v1/projects/proj_456def/assign" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "E-commerce Dashboard",
    "framework": "next",
    "description": "Admin dashboard for online store"
  }'

TypeScript SDK

Using v0-sdk
import { v0 } from 'v0-sdk'

// Assign chat to project
await v0.projects.assign({
  projectId: 'proj_456def',
  chatId: 'chat_123abc'
})
console.log('Chat assigned to project')