Claude Platform Docs

Criar URL de ação

client.UserProfiles.ActionURLs.New(ctx, userProfileID, params) (*UserProfileActionURL, error)
POST/v1/user_profiles/{user_profile_id}/action_urls

Criar URL de ação

Parameters
userProfileID string⁠Path parameter

The ID of the user profile the action is for (uprof_...).

params UserProfileActionURLNewParams

The action that the person who opens the URL takes.

WorkspaceID param.Opt[string] OptionalHeader parameter

Optional header to select the Workspace for this request. The value is a Workspace ID (for example, wrkspc_011CZkZaBF1tNoB5wlCeusgy).

Only needed for credentials that can act on more than one Workspace. A credential that belongs to a specific Workspace may omit it; if sent, it must match that Workspace.

Returns
type UserProfileActionURL struct { Type: "user_profile_action_url"; ExpiresAt; URL }

A URL to give to the person who takes the requested action.

Type UserProfileActionURL

Object type. Always user_profile_action_url.

ExpiresAt Time

When the URL stops working, in RFC 3339 format.

formatdate-time
URL string

The URL to give to the person who takes the action. Anyone who holds it can open it until expires_at.

Criar URL de ação
package main

import (
	"context"
	"fmt"

	"github.com/anthropics/anthropic-sdk-go/v2"
	"github.com/anthropics/anthropic-sdk-go/v2/option"
)

func main() {
	client := anthropic.NewClient(
		option.WithAPIKey("my-anthropic-api-key"),
	)
	userProfileActionURL, err := client.UserProfiles.ActionURLs.New(
		context.TODO(),
		"uprof_011CZkZCu8hGbp5mYRQgUmz9",
		anthropic.UserProfileActionURLNewParams{
			Action: anthropic.UserProfileActionUnionParam{
				OfEnrollEndUser: &anthropic.UserProfileEnrollEndUserActionParam{},
			},
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", userProfileActionURL.ExpiresAt)
}
Returns Examples
Response 200
{
  "expires_at": "2026-03-15T10:15:00Z",
  "type": "user_profile_action_url",
  "url": "https://platform.claude.com/user-profiles/enrollment/M3J0bGJxZ2ppMnptbnB1"
}