post/users/@me/relationships

Send friend request by tag

Sends a friend request to a user identified by username tag (username#discriminator). Returns the new relationship object. Can fail if user not found or request already sent.

send_friend_request_by_tag

Request body

application/json

json
{
  "type": "object",
  "properties": {
    "username": {
      "$ref": "#/components/schemas/UsernameType"
    },
    "discriminator": {
      "$ref": "#/components/schemas/DiscriminatorType"
    }
  },
  "required": [
    "username",
    "discriminator"
  ]
}

Responses

200

Success

json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^(0|[1-9][0-9]*)$",
      "description": "The unique identifier for the relationship"
    },
    "type": {
      "$ref": "#/components/schemas/RelationshipTypes",
      "description": "The type of relationship (friend, blocked, pending, etc.)"
    },
    "user": {
      "$ref": "#/components/schemas/UserPartialResponse"
    },
    "since": {
      "type": "string",
      "format": "date-time",
      "description": "ISO8601 timestamp of when the relationship was established"
    },
    "nickname": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "A custom nickname set for the related user"
    },
    "share_voice_activity": {
      "type": "boolean",
      "description": "Whether the current user has chosen to share their voice activity with this friend on the Active Now panel"
    },
    "friend_shares_voice_activity": {
      "type": "boolean",
      "description": "Whether this friend has chosen to share their voice activity with the current user; for non-friend types this is always true"
    }
  },
  "required": [
    "id",
    "type",
    "user",
    "nickname",
    "share_voice_activity",
    "friend_shares_voice_activity"
  ]
}
400

Bad Request - The request was malformed or contained invalid data

json
{
  "type": "object",
  "properties": {
    "code": {
      "$ref": "#/components/schemas/APIErrorCode"
    },
    "message": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "errors": {
      "type": "array",
      "description": "Field-specific validation errors",
      "items": {
        "$ref": "#/components/schemas/ValidationErrorItem"
      }
    }
  },
  "required": [
    "code",
    "message"
  ]
}
401

Unauthorized - Authentication is required or the token is invalid

json
{
  "type": "object",
  "properties": {
    "code": {
      "$ref": "#/components/schemas/APIErrorCode"
    },
    "message": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "errors": {
      "type": "array",
      "description": "Field-specific validation errors",
      "items": {
        "$ref": "#/components/schemas/ValidationErrorItem"
      }
    }
  },
  "required": [
    "code",
    "message"
  ]
}
403

Forbidden - You do not have permission to perform this action

json
{
  "type": "object",
  "properties": {
    "code": {
      "$ref": "#/components/schemas/APIErrorCode"
    },
    "message": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "errors": {
      "type": "array",
      "description": "Field-specific validation errors",
      "items": {
        "$ref": "#/components/schemas/ValidationErrorItem"
      }
    }
  },
  "required": [
    "code",
    "message"
  ]
}
429

Too Many Requests - You are being rate limited

json
{
  "type": "object",
  "properties": {
    "code": {
      "type": "string",
      "enum": [
        "RATE_LIMITED"
      ]
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "number",
      "description": "Seconds to wait before retrying"
    },
    "global": {
      "type": "boolean",
      "description": "Whether this is a global rate limit"
    }
  },
  "required": [
    "code",
    "message",
    "retry_after"
  ]
}
500

Internal Server Error - An unexpected error occurred

json
{
  "type": "object",
  "properties": {
    "code": {
      "$ref": "#/components/schemas/APIErrorCode"
    },
    "message": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "errors": {
      "type": "array",
      "description": "Field-specific validation errors",
      "items": {
        "$ref": "#/components/schemas/ValidationErrorItem"
      }
    }
  },
  "required": [
    "code",
    "message"
  ]
}