> ## Documentation Index
> Fetch the complete documentation index at: https://arize-ax.mintlify.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Projects

> List, get, create, update, and delete projects using the Arize Go SDK.

<Note>
  The `projects` client methods are currently in **ALPHA**. The API may change without notice. A one-time warning is emitted on first use.
</Note>

A project groups traces and spans for a single application within a space. The `Get`, `Update`, and `Delete` methods accept either a project name or an ID; when a name is passed, the parent `Space` (name or ID) is also required so the SDK can resolve the name to a unique ID.

## List Projects

`List` returns a paginated list of projects. When `Space` is a base64 resource ID, it is sent as the `space_id` filter (exact match); otherwise it is sent as the `space_name` filter (case-insensitive substring match).

**Signature:**

```go theme={null}
func (c *Client) List(ctx context.Context, req ListRequest) (*ProjectList, error)
```

**Usage Example:**

```go theme={null}
package main

import (
    "context"
    "errors"
    "fmt"
    "log"

    "github.com/Arize-ai/client-go-v2/arize"
    "github.com/Arize-ai/client-go-v2/arize/projects"
)

func main() {
    client, err := arize.NewClient(arize.Config{APIKey: "your-api-key"})
    if err != nil {
        log.Fatal(err)
    }

    resp, err := client.Projects.List(context.Background(), projects.ListRequest{
        Space: "your-space-name-or-id",
        Limit: 25,
    })
    if err != nil {
        var unauthorized *arize.UnauthorizedError
        if errors.As(err, &unauthorized) {
            log.Fatalf("unauthorized: %v", unauthorized)
        }
        log.Fatal(err)
    }

    for _, project := range resp.Projects {
        fmt.Printf("%s: %s (space=%s)\n", project.Id, project.Name, project.SpaceId)
    }
}
```

## Get a Project

`Get` returns a single project, resolving by name or ID. `Space` (name or ID) is required when `Project` is a name rather than an ID.

**Signature:**

```go theme={null}
func (c *Client) Get(ctx context.Context, req GetRequest) (*Project, error)
```

**Usage Example:**

```go theme={null}
package main

import (
    "context"
    "errors"
    "fmt"
    "log"

    "github.com/Arize-ai/client-go-v2/arize"
    "github.com/Arize-ai/client-go-v2/arize/projects"
)

func main() {
    client, err := arize.NewClient(arize.Config{APIKey: "your-api-key"})
    if err != nil {
        log.Fatal(err)
    }

    project, err := client.Projects.Get(
        context.Background(),
        projects.GetRequest{
            Project: "your-project-name-or-id",
            Space:   "your-space-name-or-id",
        },
    )
    if err != nil {
        var notFound *arize.NotFoundError
        if errors.As(err, &notFound) {
            log.Fatalf("project not found: %v", notFound)
        }
        log.Fatal(err)
    }

    fmt.Printf("project %s: %s (space=%s)\n", project.Id, project.Name, project.SpaceId)
}
```

## Create a Project

`Create` issues a `POST` to create a new project in the given space, resolving the parent space by name or ID, and returns the created project.

**Signature:**

```go theme={null}
func (c *Client) Create(ctx context.Context, req CreateRequest) (*Project, error)
```

**Usage Example:**

```go theme={null}
package main

import (
    "context"
    "errors"
    "fmt"
    "log"

    "github.com/Arize-ai/client-go-v2/arize"
    "github.com/Arize-ai/client-go-v2/arize/projects"
)

func main() {
    client, err := arize.NewClient(arize.Config{APIKey: "your-api-key"})
    if err != nil {
        log.Fatal(err)
    }

    project, err := client.Projects.Create(
        context.Background(),
        projects.CreateRequest{
            Name:  "your-new-project",
            Space: "your-space-name-or-id",
        },
    )
    if err != nil {
        var conflict *arize.ConflictError
        if errors.As(err, &conflict) {
            log.Fatalf("project already exists: %v", conflict)
        }
        log.Fatal(err)
    }

    fmt.Printf("created project %s\n", project.Id)
}
```

## Update a Project

`Update` renames an existing project, resolving the target by name or ID, and returns the updated project. `Space` is required when `Project` is a name rather than an ID.

**Signature:**

```go theme={null}
func (c *Client) Update(
    ctx context.Context,
    req UpdateRequest,
) (*Project, error)
```

**Usage Example:**

```go theme={null}
package main

import (
    "context"
    "errors"
    "fmt"
    "log"

    "github.com/Arize-ai/client-go-v2/arize"
    "github.com/Arize-ai/client-go-v2/arize/projects"
)

func main() {
    client, err := arize.NewClient(arize.Config{APIKey: "your-api-key"})
    if err != nil {
        log.Fatal(err)
    }

    project, err := client.Projects.Update(
        context.Background(),
        projects.UpdateRequest{
            Project: "your-project-name-or-id",
            Space:   "your-space-name-or-id",
            Name:    "renamed-project",
        },
    )
    if err != nil {
        var notFound *arize.NotFoundError
        if errors.As(err, &notFound) {
            log.Fatalf("project not found: %v", notFound)
        }
        log.Fatal(err)
    }

    fmt.Printf("updated project %s: %s\n", project.Id, project.Name)
}
```

## Delete a Project

`Delete` removes a project, resolving by name or ID. `Space` is required when `Project` is a name rather than an ID. It returns only an error.

**Signature:**

```go theme={null}
func (c *Client) Delete(ctx context.Context, req DeleteRequest) error
```

**Usage Example:**

```go theme={null}
package main

import (
    "context"
    "errors"
    "log"

    "github.com/Arize-ai/client-go-v2/arize"
    "github.com/Arize-ai/client-go-v2/arize/projects"
)

func main() {
    client, err := arize.NewClient(arize.Config{APIKey: "your-api-key"})
    if err != nil {
        log.Fatal(err)
    }

    err = client.Projects.Delete(
        context.Background(),
        projects.DeleteRequest{
            Project: "your-project-name-or-id",
            Space:   "your-space-name-or-id",
        },
    )
    if err != nil {
        var notFound *arize.NotFoundError
        if errors.As(err, &notFound) {
            log.Printf("no project to remove: %v", notFound)
            return
        }
        log.Fatal(err)
    }
}
```
