# MsgSetValidTokenIds

**Disclaimer:**\
This message is a streamlined alternative to [MsgUpdateCollection](/token-standard/messages/msg-update-collection.md). If you need to update many fields at once, we recommend using MsgUpdateCollection instead.

## MsgSetValidTokenIds

Sets the valid token IDs and update permissions for a collection. This is a convenience message that focuses specifically on token ID management.

### Overview

This message allows you to:

* Set which token IDs are valid for the collection
* Configure permissions to update the valid token IDs in the future

### Authorization & Permissions

Updates can only be performed by the **current manager** of the collection. The manager must have permission to update valid token IDs according to the collection's current permission settings.

### Proto Definition

```protobuf
message MsgSetValidTokenIds {
  option (cosmos.msg.v1.signer) = "creator";
  option (amino.name) = "tokenization/SetValidTokenIds";

  // Address of the creator.
  string creator = 1;

  // ID of the collection.
  string collectionId = 2 [(gogoproto.customtype) = "Uint", (gogoproto.nullable) = false];

  // New token IDs to add to this collection
  repeated UintRange validTokenIds = 3;

  // Permission to update valid token IDs
  repeated TokenIdsActionPermission canUpdateValidTokenIds = 4;
}

message MsgSetValidTokenIdsResponse {
  // ID of the collection.
  string collectionId = 1 [(gogoproto.customtype) = "Uint", (gogoproto.nullable) = false];
}
```

### Usage Example

```bash
# CLI command
bitbadgeschaind tx tokenization set-valid-token-ids '[tx-json]' --from manager-key
```

#### JSON Example

```json
{
    "creator": "bb1abc123...",
    "collectionId": "1",
    "validTokenIds": [
        { "start": "1", "end": "100" },
        { "start": "200", "end": "300" }
    ],
    "canUpdateValidTokenIds": [
        {
            "tokenIds": [{ "start": "1", "end": "50" }],
            "permanentlyPermittedTimes": [{ "start": "1000", "end": "2000" }],
            "permanentlyForbiddenTimes": []
        }
    ]
}
```

### Related Messages

* [MsgUniversalUpdateCollection](/token-standard/messages/msg-universal-update-collection.md) - Full collection update with all fields
* [MsgUpdateCollection](/token-standard/messages/msg-update-collection.md) - Legacy update message


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bitbadges.io/token-standard/messages/msg-set-valid-token-ids.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
