anthropic 1.81.0 → 1.82.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/README.md +1 -1
  4. data/lib/anthropic/internal/report_page_cursor.rb +1 -1
  5. data/lib/anthropic/internal/tracing.rb +7 -0
  6. data/lib/anthropic/models/anthropic_beta.rb +3 -0
  7. data/lib/anthropic/models/beta/beta_webhook_event.rb +2 -2
  8. data/lib/anthropic/models/beta/beta_webhook_event_data.rb +16 -2
  9. data/lib/anthropic/models/beta/beta_webhook_user_profile_enforcement_action_opened_event_data.rb +43 -0
  10. data/lib/anthropic/models/beta/beta_webhook_user_profile_enforcement_action_resolved_event_data.rb +43 -0
  11. data/lib/anthropic/models/beta/organization/beta_deleted_organization_webhook_endpoint.rb +31 -0
  12. data/lib/anthropic/models/beta/organization/beta_new_organization_webhook_endpoint.rb +113 -0
  13. data/lib/anthropic/models/beta/organization/beta_organization_webhook_endpoint.rb +104 -0
  14. data/lib/anthropic/models/beta/organization/beta_organization_webhook_endpoint_signing_secret.rb +28 -0
  15. data/lib/anthropic/models/beta/organization/beta_organization_webhook_endpoint_state.rb +20 -0
  16. data/lib/anthropic/models/beta/organization/webhook_create_params.rb +73 -0
  17. data/lib/anthropic/models/beta/organization/webhook_delete_params.rb +38 -0
  18. data/lib/anthropic/models/beta/organization/webhook_list_params.rb +75 -0
  19. data/lib/anthropic/models/beta/organization/webhook_regenerate_signing_secret_params.rb +39 -0
  20. data/lib/anthropic/models/beta/organization/webhook_retrieve_params.rb +38 -0
  21. data/lib/anthropic/models/beta/organization/webhook_update_params.rb +105 -0
  22. data/lib/anthropic/resources/beta/organization/webhooks.rb +287 -0
  23. data/lib/anthropic/resources/beta/organization.rb +4 -0
  24. data/lib/anthropic/version.rb +1 -1
  25. data/lib/anthropic.rb +14 -0
  26. data/rbi/anthropic/internal/tracing.rbi +8 -0
  27. data/rbi/anthropic/models/anthropic_beta.rbi +2 -0
  28. data/rbi/anthropic/models/beta/beta_webhook_event.rbi +3 -1
  29. data/rbi/anthropic/models/beta/beta_webhook_event_data.rbi +19 -4
  30. data/rbi/anthropic/models/beta/beta_webhook_user_profile_enforcement_action_opened_event_data.rbi +65 -0
  31. data/rbi/anthropic/models/beta/beta_webhook_user_profile_enforcement_action_resolved_event_data.rbi +65 -0
  32. data/rbi/anthropic/models/beta/organization/beta_deleted_organization_webhook_endpoint.rbi +41 -0
  33. data/rbi/anthropic/models/beta/organization/beta_new_organization_webhook_endpoint.rbi +175 -0
  34. data/rbi/anthropic/models/beta/organization/beta_organization_webhook_endpoint.rbi +164 -0
  35. data/rbi/anthropic/models/beta/organization/beta_organization_webhook_endpoint_signing_secret.rbi +37 -0
  36. data/rbi/anthropic/models/beta/organization/beta_organization_webhook_endpoint_state.rbi +44 -0
  37. data/rbi/anthropic/models/beta/organization/webhook_create_params.rbi +151 -0
  38. data/rbi/anthropic/models/beta/organization/webhook_delete_params.rbi +75 -0
  39. data/rbi/anthropic/models/beta/organization/webhook_list_params.rbi +153 -0
  40. data/rbi/anthropic/models/beta/organization/webhook_regenerate_signing_secret_params.rbi +75 -0
  41. data/rbi/anthropic/models/beta/organization/webhook_retrieve_params.rbi +75 -0
  42. data/rbi/anthropic/models/beta/organization/webhook_update_params.rbi +241 -0
  43. data/rbi/anthropic/resources/beta/organization/webhooks.rbi +248 -0
  44. data/rbi/anthropic/resources/beta/organization.rbi +3 -0
  45. data/sig/anthropic/internal/tracing.rbs +6 -0
  46. data/sig/anthropic/models/anthropic_beta.rbs +2 -0
  47. data/sig/anthropic/models/beta/beta_webhook_event_data.rbs +23 -2
  48. data/sig/anthropic/models/beta/beta_webhook_user_profile_enforcement_action_opened_event_data.rbs +39 -0
  49. data/sig/anthropic/models/beta/beta_webhook_user_profile_enforcement_action_resolved_event_data.rbs +39 -0
  50. data/sig/anthropic/models/beta/organization/beta_deleted_organization_webhook_endpoint.rbs +20 -0
  51. data/sig/anthropic/models/beta/organization/beta_new_organization_webhook_endpoint.rbs +82 -0
  52. data/sig/anthropic/models/beta/organization/beta_organization_webhook_endpoint.rbs +77 -0
  53. data/sig/anthropic/models/beta/organization/beta_organization_webhook_endpoint_signing_secret.rbs +18 -0
  54. data/sig/anthropic/models/beta/organization/beta_organization_webhook_endpoint_state.rbs +18 -0
  55. data/sig/anthropic/models/beta/organization/webhook_create_params.rbs +71 -0
  56. data/sig/anthropic/models/beta/organization/webhook_delete_params.rbs +39 -0
  57. data/sig/anthropic/models/beta/organization/webhook_list_params.rbs +67 -0
  58. data/sig/anthropic/models/beta/organization/webhook_regenerate_signing_secret_params.rbs +39 -0
  59. data/sig/anthropic/models/beta/organization/webhook_retrieve_params.rbs +39 -0
  60. data/sig/anthropic/models/beta/organization/webhook_update_params.rbs +102 -0
  61. data/sig/anthropic/resources/beta/organization/webhooks.rbs +58 -0
  62. data/sig/anthropic/resources/beta/organization.rbs +2 -0
  63. metadata +43 -1
@@ -0,0 +1,73 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ module Organization
7
+ # @see Anthropic::Resources::Beta::Organization::Webhooks#create
8
+ class WebhookCreateParams < Anthropic::Internal::Type::BaseModel
9
+ extend Anthropic::Internal::Type::RequestParameters::Converter
10
+ include Anthropic::Internal::Type::RequestParameters
11
+
12
+ # @!attribute enabled_events
13
+ # The event types to deliver to the endpoint. Must list at least one.
14
+ #
15
+ # @return [Array<Symbol, Anthropic::Models::Beta::Organization::WebhookCreateParams::EnabledEvent>]
16
+ required :enabled_events,
17
+ -> { Anthropic::Internal::Type::ArrayOf[enum: Anthropic::Beta::Organization::WebhookCreateParams::EnabledEvent] }
18
+
19
+ # @!attribute url
20
+ # The HTTPS URL that deliveries are sent to.
21
+ #
22
+ # @return [String]
23
+ required :url, String
24
+
25
+ # @!attribute description
26
+ # Notes about the endpoint.
27
+ #
28
+ # @return [String, nil]
29
+ optional :description, String
30
+
31
+ # @!attribute name
32
+ # A short label for the endpoint.
33
+ #
34
+ # @return [String, nil]
35
+ optional :name, String
36
+
37
+ # @!attribute betas
38
+ # This endpoint is in beta: requests must send `webhooks-2026-10-07` in this
39
+ # header.
40
+ #
41
+ # @return [Array<Symbol, String, Anthropic::Models::AnthropicBeta>, nil]
42
+ optional :betas, -> { Anthropic::Internal::Type::ArrayOf[union: Anthropic::AnthropicBeta] }
43
+
44
+ # @!method initialize(enabled_events:, url:, description: nil, name: nil, betas: nil, request_options: {})
45
+ # Some parameter documentations has been truncated, see
46
+ # {Anthropic::Models::Beta::Organization::WebhookCreateParams} for more details.
47
+ #
48
+ # @param enabled_events [Array<Symbol, Anthropic::Models::Beta::Organization::WebhookCreateParams::EnabledEvent>] The event types to deliver to the endpoint. Must list at least one.
49
+ #
50
+ # @param url [String] The HTTPS URL that deliveries are sent to.
51
+ #
52
+ # @param description [String] Notes about the endpoint.
53
+ #
54
+ # @param name [String] A short label for the endpoint.
55
+ #
56
+ # @param betas [Array<Symbol, String, Anthropic::Models::AnthropicBeta>] This endpoint is in beta: requests must send `webhooks-2026-10-07` in this heade
57
+ #
58
+ # @param request_options [Anthropic::RequestOptions, Hash{Symbol=>Object}]
59
+
60
+ module EnabledEvent
61
+ extend Anthropic::Internal::Type::Enum
62
+
63
+ USER_PROFILE_ENFORCEMENT_ACTION_OPENED = :"user_profile.enforcement_action_opened"
64
+ USER_PROFILE_ENFORCEMENT_ACTION_RESOLVED = :"user_profile.enforcement_action_resolved"
65
+
66
+ # @!method self.values
67
+ # @return [Array<Symbol>]
68
+ end
69
+ end
70
+ end
71
+ end
72
+ end
73
+ end
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ module Organization
7
+ # @see Anthropic::Resources::Beta::Organization::Webhooks#delete
8
+ class WebhookDeleteParams < Anthropic::Internal::Type::BaseModel
9
+ extend Anthropic::Internal::Type::RequestParameters::Converter
10
+ include Anthropic::Internal::Type::RequestParameters
11
+
12
+ # @!attribute webhook_endpoint_id
13
+ # ID of the webhook endpoint.
14
+ #
15
+ # @return [String]
16
+ required :webhook_endpoint_id, String
17
+
18
+ # @!attribute betas
19
+ # This endpoint is in beta: requests must send `webhooks-2026-10-07` in this
20
+ # header.
21
+ #
22
+ # @return [Array<Symbol, String, Anthropic::Models::AnthropicBeta>, nil]
23
+ optional :betas, -> { Anthropic::Internal::Type::ArrayOf[union: Anthropic::AnthropicBeta] }
24
+
25
+ # @!method initialize(webhook_endpoint_id:, betas: nil, request_options: {})
26
+ # Some parameter documentations has been truncated, see
27
+ # {Anthropic::Models::Beta::Organization::WebhookDeleteParams} for more details.
28
+ #
29
+ # @param webhook_endpoint_id [String] ID of the webhook endpoint.
30
+ #
31
+ # @param betas [Array<Symbol, String, Anthropic::Models::AnthropicBeta>] This endpoint is in beta: requests must send `webhooks-2026-10-07` in this heade
32
+ #
33
+ # @param request_options [Anthropic::RequestOptions, Hash{Symbol=>Object}]
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,75 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ module Organization
7
+ # @see Anthropic::Resources::Beta::Organization::Webhooks#list
8
+ class WebhookListParams < Anthropic::Internal::Type::BaseModel
9
+ extend Anthropic::Internal::Type::RequestParameters::Converter
10
+ include Anthropic::Internal::Type::RequestParameters
11
+
12
+ # @!attribute after_id
13
+ # ID of the object to use as a cursor for pagination. When provided, returns the
14
+ # page of results immediately after this object.
15
+ #
16
+ # @return [String, nil]
17
+ optional :after_id, String, nil?: true
18
+
19
+ # @!attribute before_id
20
+ # ID of a webhook endpoint to use as a cursor. Returns the first `limit` endpoints
21
+ # that come before it in list order, not the `limit` endpoints just before it.
22
+ #
23
+ # @return [String, nil]
24
+ optional :before_id, String, nil?: true
25
+
26
+ # @!attribute limit
27
+ # Number of items to return per page, up to `100`. The default, `0`, means `20`.
28
+ #
29
+ # @return [Integer, nil]
30
+ optional :limit, Integer
31
+
32
+ # @!attribute order
33
+ # Sort order by `created_at`. Defaults to `desc`, newest first.
34
+ #
35
+ # @return [Symbol, Anthropic::Models::Beta::Organization::WebhookListParams::Order, nil]
36
+ optional :order, enum: -> { Anthropic::Beta::Organization::WebhookListParams::Order }, nil?: true
37
+
38
+ # @!attribute betas
39
+ # This endpoint is in beta: requests must send `webhooks-2026-10-07` in this
40
+ # header.
41
+ #
42
+ # @return [Array<Symbol, String, Anthropic::Models::AnthropicBeta>, nil]
43
+ optional :betas, -> { Anthropic::Internal::Type::ArrayOf[union: Anthropic::AnthropicBeta] }
44
+
45
+ # @!method initialize(after_id: nil, before_id: nil, limit: nil, order: nil, betas: nil, request_options: {})
46
+ # Some parameter documentations has been truncated, see
47
+ # {Anthropic::Models::Beta::Organization::WebhookListParams} for more details.
48
+ #
49
+ # @param after_id [String, nil] ID of the object to use as a cursor for pagination. When provided, returns the p
50
+ #
51
+ # @param before_id [String, nil] ID of a webhook endpoint to use as a cursor. Returns the first `limit` endpoints
52
+ #
53
+ # @param limit [Integer] Number of items to return per page, up to `100`. The default, `0`, means `20`.
54
+ #
55
+ # @param order [Symbol, Anthropic::Models::Beta::Organization::WebhookListParams::Order, nil] Sort order by `created_at`. Defaults to `desc`, newest first.
56
+ #
57
+ # @param betas [Array<Symbol, String, Anthropic::Models::AnthropicBeta>] This endpoint is in beta: requests must send `webhooks-2026-10-07` in this heade
58
+ #
59
+ # @param request_options [Anthropic::RequestOptions, Hash{Symbol=>Object}]
60
+
61
+ # Sort order by `created_at`. Defaults to `desc`, newest first.
62
+ module Order
63
+ extend Anthropic::Internal::Type::Enum
64
+
65
+ ASC = :asc
66
+ DESC = :desc
67
+
68
+ # @!method self.values
69
+ # @return [Array<Symbol>]
70
+ end
71
+ end
72
+ end
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ module Organization
7
+ # @see Anthropic::Resources::Beta::Organization::Webhooks#regenerate_signing_secret
8
+ class WebhookRegenerateSigningSecretParams < Anthropic::Internal::Type::BaseModel
9
+ extend Anthropic::Internal::Type::RequestParameters::Converter
10
+ include Anthropic::Internal::Type::RequestParameters
11
+
12
+ # @!attribute webhook_endpoint_id
13
+ # ID of the webhook endpoint.
14
+ #
15
+ # @return [String]
16
+ required :webhook_endpoint_id, String
17
+
18
+ # @!attribute betas
19
+ # This endpoint is in beta: requests must send `webhooks-2026-10-07` in this
20
+ # header.
21
+ #
22
+ # @return [Array<Symbol, String, Anthropic::Models::AnthropicBeta>, nil]
23
+ optional :betas, -> { Anthropic::Internal::Type::ArrayOf[union: Anthropic::AnthropicBeta] }
24
+
25
+ # @!method initialize(webhook_endpoint_id:, betas: nil, request_options: {})
26
+ # Some parameter documentations has been truncated, see
27
+ # {Anthropic::Models::Beta::Organization::WebhookRegenerateSigningSecretParams}
28
+ # for more details.
29
+ #
30
+ # @param webhook_endpoint_id [String] ID of the webhook endpoint.
31
+ #
32
+ # @param betas [Array<Symbol, String, Anthropic::Models::AnthropicBeta>] This endpoint is in beta: requests must send `webhooks-2026-10-07` in this heade
33
+ #
34
+ # @param request_options [Anthropic::RequestOptions, Hash{Symbol=>Object}]
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ module Organization
7
+ # @see Anthropic::Resources::Beta::Organization::Webhooks#retrieve
8
+ class WebhookRetrieveParams < Anthropic::Internal::Type::BaseModel
9
+ extend Anthropic::Internal::Type::RequestParameters::Converter
10
+ include Anthropic::Internal::Type::RequestParameters
11
+
12
+ # @!attribute webhook_endpoint_id
13
+ # ID of the webhook endpoint.
14
+ #
15
+ # @return [String]
16
+ required :webhook_endpoint_id, String
17
+
18
+ # @!attribute betas
19
+ # This endpoint is in beta: requests must send `webhooks-2026-10-07` in this
20
+ # header.
21
+ #
22
+ # @return [Array<Symbol, String, Anthropic::Models::AnthropicBeta>, nil]
23
+ optional :betas, -> { Anthropic::Internal::Type::ArrayOf[union: Anthropic::AnthropicBeta] }
24
+
25
+ # @!method initialize(webhook_endpoint_id:, betas: nil, request_options: {})
26
+ # Some parameter documentations has been truncated, see
27
+ # {Anthropic::Models::Beta::Organization::WebhookRetrieveParams} for more details.
28
+ #
29
+ # @param webhook_endpoint_id [String] ID of the webhook endpoint.
30
+ #
31
+ # @param betas [Array<Symbol, String, Anthropic::Models::AnthropicBeta>] This endpoint is in beta: requests must send `webhooks-2026-10-07` in this heade
32
+ #
33
+ # @param request_options [Anthropic::RequestOptions, Hash{Symbol=>Object}]
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,105 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ module Organization
7
+ # @see Anthropic::Resources::Beta::Organization::Webhooks#update
8
+ class WebhookUpdateParams < Anthropic::Internal::Type::BaseModel
9
+ extend Anthropic::Internal::Type::RequestParameters::Converter
10
+ include Anthropic::Internal::Type::RequestParameters
11
+
12
+ # @!attribute webhook_endpoint_id
13
+ # ID of the webhook endpoint.
14
+ #
15
+ # @return [String]
16
+ required :webhook_endpoint_id, String
17
+
18
+ # @!attribute description
19
+ # Notes about the endpoint.
20
+ #
21
+ # @return [String, nil]
22
+ optional :description, String
23
+
24
+ # @!attribute enabled_events
25
+ # The event types to deliver to the endpoint. Replaces the whole set; an empty
26
+ # list leaves it unchanged.
27
+ #
28
+ # @return [Array<Symbol, Anthropic::Models::Beta::Organization::WebhookUpdateParams::EnabledEvent>, nil]
29
+ optional :enabled_events,
30
+ -> { Anthropic::Internal::Type::ArrayOf[enum: Anthropic::Beta::Organization::WebhookUpdateParams::EnabledEvent] }
31
+
32
+ # @!attribute name
33
+ # A short label for the endpoint.
34
+ #
35
+ # @return [String, nil]
36
+ optional :name, String
37
+
38
+ # @!attribute state
39
+ # `disabled` stops deliveries. `enabled` resumes them and clears
40
+ # `disabled_reason`. Events that happen while the endpoint is disabled are never
41
+ # delivered.
42
+ #
43
+ # @return [Symbol, Anthropic::Models::Beta::Organization::WebhookUpdateParams::State, nil]
44
+ optional :state, enum: -> { Anthropic::Beta::Organization::WebhookUpdateParams::State }
45
+
46
+ # @!attribute url
47
+ # The HTTPS URL that deliveries are sent to.
48
+ #
49
+ # @return [String, nil]
50
+ optional :url, String
51
+
52
+ # @!attribute betas
53
+ # This endpoint is in beta: requests must send `webhooks-2026-10-07` in this
54
+ # header.
55
+ #
56
+ # @return [Array<Symbol, String, Anthropic::Models::AnthropicBeta>, nil]
57
+ optional :betas, -> { Anthropic::Internal::Type::ArrayOf[union: Anthropic::AnthropicBeta] }
58
+
59
+ # @!method initialize(webhook_endpoint_id:, description: nil, enabled_events: nil, name: nil, state: nil, url: nil, betas: nil, request_options: {})
60
+ # Some parameter documentations has been truncated, see
61
+ # {Anthropic::Models::Beta::Organization::WebhookUpdateParams} for more details.
62
+ #
63
+ # @param webhook_endpoint_id [String] ID of the webhook endpoint.
64
+ #
65
+ # @param description [String] Notes about the endpoint.
66
+ #
67
+ # @param enabled_events [Array<Symbol, Anthropic::Models::Beta::Organization::WebhookUpdateParams::EnabledEvent>] The event types to deliver to the endpoint. Replaces the whole set; an empty lis
68
+ #
69
+ # @param name [String] A short label for the endpoint.
70
+ #
71
+ # @param state [Symbol, Anthropic::Models::Beta::Organization::WebhookUpdateParams::State] `disabled` stops deliveries. `enabled` resumes them and clears `disabled_reason`
72
+ #
73
+ # @param url [String] The HTTPS URL that deliveries are sent to.
74
+ #
75
+ # @param betas [Array<Symbol, String, Anthropic::Models::AnthropicBeta>] This endpoint is in beta: requests must send `webhooks-2026-10-07` in this heade
76
+ #
77
+ # @param request_options [Anthropic::RequestOptions, Hash{Symbol=>Object}]
78
+
79
+ module EnabledEvent
80
+ extend Anthropic::Internal::Type::Enum
81
+
82
+ USER_PROFILE_ENFORCEMENT_ACTION_OPENED = :"user_profile.enforcement_action_opened"
83
+ USER_PROFILE_ENFORCEMENT_ACTION_RESOLVED = :"user_profile.enforcement_action_resolved"
84
+
85
+ # @!method self.values
86
+ # @return [Array<Symbol>]
87
+ end
88
+
89
+ # `disabled` stops deliveries. `enabled` resumes them and clears
90
+ # `disabled_reason`. Events that happen while the endpoint is disabled are never
91
+ # delivered.
92
+ module State
93
+ extend Anthropic::Internal::Type::Enum
94
+
95
+ DISABLED = :disabled
96
+ ENABLED = :enabled
97
+
98
+ # @!method self.values
99
+ # @return [Array<Symbol>]
100
+ end
101
+ end
102
+ end
103
+ end
104
+ end
105
+ end
@@ -0,0 +1,287 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Resources
5
+ class Beta
6
+ class Organization
7
+ class Webhooks
8
+ # Create an organization webhook endpoint.
9
+ #
10
+ # An organization webhook endpoint belongs to the organization rather than to one
11
+ # of its workspaces. An organization can have at most 32 organization webhook
12
+ # endpoints, enabled or disabled.
13
+ #
14
+ # The response includes the endpoint's signing secret. No read returns it, so
15
+ # store it when you receive it.
16
+ #
17
+ # Every request must include the beta header
18
+ # `anthropic-beta: webhooks-2026-10-07`. A request without it returns `404`,
19
+ # exactly as if this API did not exist. Anthropic turns organization webhook
20
+ # endpoints on for each organization; until yours is on, requests also return
21
+ # `404`. Organization webhook endpoints are in beta and are not available to
22
+ # organizations with HIPAA readiness enabled.
23
+ #
24
+ # Some parameter documentations has been truncated, see
25
+ # {Anthropic::Models::Beta::Organization::WebhookCreateParams} for more details.
26
+ #
27
+ # @overload create(enabled_events:, url:, description: nil, name: nil, betas: nil, request_options: {})
28
+ #
29
+ # @param enabled_events [Array<Symbol, Anthropic::Models::Beta::Organization::WebhookCreateParams::EnabledEvent>] Body param: The event types to deliver to the endpoint. Must list at least one.
30
+ #
31
+ # @param url [String] Body param: The HTTPS URL that deliveries are sent to.
32
+ #
33
+ # @param description [String] Body param: Notes about the endpoint.
34
+ #
35
+ # @param name [String] Body param: A short label for the endpoint.
36
+ #
37
+ # @param betas [Array<Symbol, String, Anthropic::Models::AnthropicBeta>] Header param: This endpoint is in beta: requests must send `webhooks-2026-10-07`
38
+ #
39
+ # @param request_options [Anthropic::RequestOptions, Hash{Symbol=>Object}, nil]
40
+ #
41
+ # @return [Anthropic::Models::Beta::Organization::BetaNewOrganizationWebhookEndpoint]
42
+ #
43
+ # @see Anthropic::Models::Beta::Organization::WebhookCreateParams
44
+ def create(params)
45
+ parsed, options = Anthropic::Beta::Organization::WebhookCreateParams.dump_request(params)
46
+ header_params = {betas: "anthropic-beta"}
47
+ @client.request(
48
+ span_name: Anthropic::Internal::Tracing::SpanName::ORGANIZATION_WEBHOOKS_CREATE,
49
+ span_created_id: "anthropic.organization.webhook.id",
50
+ span_route: "/v1/organizations/webhooks",
51
+ method: :post,
52
+ path: "v1/organizations/webhooks?beta=true",
53
+ headers: parsed.slice(*header_params.keys).transform_keys(header_params),
54
+ body: parsed.except(*header_params.keys),
55
+ model: Anthropic::Beta::Organization::BetaNewOrganizationWebhookEndpoint,
56
+ options: {extra_headers: {"anthropic-beta" => "webhooks-2026-10-07"}, **options}
57
+ )
58
+ end
59
+
60
+ # Retrieve an organization webhook endpoint by ID.
61
+ #
62
+ # Every request must include the beta header
63
+ # `anthropic-beta: webhooks-2026-10-07`. A request without it returns `404`,
64
+ # exactly as if this API did not exist. Anthropic turns organization webhook
65
+ # endpoints on for each organization; until yours is on, requests also return
66
+ # `404`. Organization webhook endpoints are in beta and are not available to
67
+ # organizations with HIPAA readiness enabled.
68
+ #
69
+ # Some parameter documentations has been truncated, see
70
+ # {Anthropic::Models::Beta::Organization::WebhookRetrieveParams} for more details.
71
+ #
72
+ # @overload retrieve(webhook_endpoint_id, betas: nil, request_options: {})
73
+ #
74
+ # @param webhook_endpoint_id [String] ID of the webhook endpoint.
75
+ #
76
+ # @param betas [Array<Symbol, String, Anthropic::Models::AnthropicBeta>] This endpoint is in beta: requests must send `webhooks-2026-10-07` in this heade
77
+ #
78
+ # @param request_options [Anthropic::RequestOptions, Hash{Symbol=>Object}, nil]
79
+ #
80
+ # @return [Anthropic::Models::Beta::Organization::BetaOrganizationWebhookEndpoint]
81
+ #
82
+ # @see Anthropic::Models::Beta::Organization::WebhookRetrieveParams
83
+ def retrieve(webhook_endpoint_id, params = {})
84
+ parsed, options = Anthropic::Beta::Organization::WebhookRetrieveParams.dump_request(params)
85
+ @client.request(
86
+ span_name: Anthropic::Internal::Tracing::SpanName::ORGANIZATION_WEBHOOKS_RETRIEVE,
87
+ span_attributes: {"anthropic.organization.webhook.id" => webhook_endpoint_id},
88
+ span_route: "/v1/organizations/webhooks/{webhook_endpoint_id}",
89
+ method: :get,
90
+ path: ["v1/organizations/webhooks/%1$s?beta=true", webhook_endpoint_id],
91
+ headers: parsed.transform_keys(betas: "anthropic-beta"),
92
+ model: Anthropic::Beta::Organization::BetaOrganizationWebhookEndpoint,
93
+ options: {extra_headers: {"anthropic-beta" => "webhooks-2026-10-07"}, **options}
94
+ )
95
+ end
96
+
97
+ # Update an organization webhook endpoint. Only the fields you send are changed.
98
+ #
99
+ # Every request must include the beta header
100
+ # `anthropic-beta: webhooks-2026-10-07`. A request without it returns `404`,
101
+ # exactly as if this API did not exist. Anthropic turns organization webhook
102
+ # endpoints on for each organization; until yours is on, requests also return
103
+ # `404`. Organization webhook endpoints are in beta and are not available to
104
+ # organizations with HIPAA readiness enabled.
105
+ #
106
+ # Some parameter documentations has been truncated, see
107
+ # {Anthropic::Models::Beta::Organization::WebhookUpdateParams} for more details.
108
+ #
109
+ # @overload update(webhook_endpoint_id, description: nil, enabled_events: nil, name: nil, state: nil, url: nil, betas: nil, request_options: {})
110
+ #
111
+ # @param webhook_endpoint_id [String] Path param: ID of the webhook endpoint.
112
+ #
113
+ # @param description [String] Body param: Notes about the endpoint.
114
+ #
115
+ # @param enabled_events [Array<Symbol, Anthropic::Models::Beta::Organization::WebhookUpdateParams::EnabledEvent>] Body param: The event types to deliver to the endpoint. Replaces the whole set;
116
+ #
117
+ # @param name [String] Body param: A short label for the endpoint.
118
+ #
119
+ # @param state [Symbol, Anthropic::Models::Beta::Organization::WebhookUpdateParams::State] Body param: `disabled` stops deliveries. `enabled` resumes them and clears `disa
120
+ #
121
+ # @param url [String] Body param: The HTTPS URL that deliveries are sent to.
122
+ #
123
+ # @param betas [Array<Symbol, String, Anthropic::Models::AnthropicBeta>] Header param: This endpoint is in beta: requests must send `webhooks-2026-10-07`
124
+ #
125
+ # @param request_options [Anthropic::RequestOptions, Hash{Symbol=>Object}, nil]
126
+ #
127
+ # @return [Anthropic::Models::Beta::Organization::BetaOrganizationWebhookEndpoint]
128
+ #
129
+ # @see Anthropic::Models::Beta::Organization::WebhookUpdateParams
130
+ def update(webhook_endpoint_id, params = {})
131
+ parsed, options = Anthropic::Beta::Organization::WebhookUpdateParams.dump_request(params)
132
+ header_params = {betas: "anthropic-beta"}
133
+ @client.request(
134
+ span_name: Anthropic::Internal::Tracing::SpanName::ORGANIZATION_WEBHOOKS_UPDATE,
135
+ span_attributes: {"anthropic.organization.webhook.id" => webhook_endpoint_id},
136
+ span_route: "/v1/organizations/webhooks/{webhook_endpoint_id}",
137
+ method: :post,
138
+ path: ["v1/organizations/webhooks/%1$s?beta=true", webhook_endpoint_id],
139
+ headers: parsed.slice(*header_params.keys).transform_keys(header_params),
140
+ body: parsed.except(*header_params.keys),
141
+ model: Anthropic::Beta::Organization::BetaOrganizationWebhookEndpoint,
142
+ options: {extra_headers: {"anthropic-beta" => "webhooks-2026-10-07"}, **options}
143
+ )
144
+ end
145
+
146
+ # List the organization's webhook endpoints.
147
+ #
148
+ # An organization webhook endpoint belongs to the organization rather than to one
149
+ # of its workspaces. The list does not include webhook endpoints that belong to a
150
+ # workspace.
151
+ #
152
+ # Every request must include the beta header
153
+ # `anthropic-beta: webhooks-2026-10-07`. A request without it returns `404`,
154
+ # exactly as if this API did not exist. Anthropic turns organization webhook
155
+ # endpoints on for each organization; until yours is on, requests also return
156
+ # `404`. Organization webhook endpoints are in beta and are not available to
157
+ # organizations with HIPAA readiness enabled.
158
+ #
159
+ # Some parameter documentations has been truncated, see
160
+ # {Anthropic::Models::Beta::Organization::WebhookListParams} for more details.
161
+ #
162
+ # @overload list(after_id: nil, before_id: nil, limit: nil, order: nil, betas: nil, request_options: {})
163
+ #
164
+ # @param after_id [String, nil] Query param: ID of the object to use as a cursor for pagination. When provided,
165
+ #
166
+ # @param before_id [String, nil] Query param: ID of a webhook endpoint to use as a cursor. Returns the first `lim
167
+ #
168
+ # @param limit [Integer] Query param: Number of items to return per page, up to `100`. The default, `0`,
169
+ #
170
+ # @param order [Symbol, Anthropic::Models::Beta::Organization::WebhookListParams::Order, nil] Query param: Sort order by `created_at`. Defaults to `desc`, newest first.
171
+ #
172
+ # @param betas [Array<Symbol, String, Anthropic::Models::AnthropicBeta>] Header param: This endpoint is in beta: requests must send `webhooks-2026-10-07`
173
+ #
174
+ # @param request_options [Anthropic::RequestOptions, Hash{Symbol=>Object}, nil]
175
+ #
176
+ # @return [Anthropic::Internal::Page<Anthropic::Models::Beta::Organization::BetaOrganizationWebhookEndpoint>]
177
+ #
178
+ # @see Anthropic::Models::Beta::Organization::WebhookListParams
179
+ def list(params = {})
180
+ query_params = [:after_id, :before_id, :limit, :order]
181
+ parsed, options = Anthropic::Beta::Organization::WebhookListParams.dump_request(params)
182
+ query = Anthropic::Internal::Util.encode_query_params(parsed.slice(*query_params))
183
+ @client.request(
184
+ span_name: Anthropic::Internal::Tracing::SpanName::ORGANIZATION_WEBHOOKS_LIST,
185
+ span_route: "/v1/organizations/webhooks",
186
+ span_query: %w[after_id before_id limit order],
187
+ method: :get,
188
+ path: "v1/organizations/webhooks?beta=true",
189
+ query: query,
190
+ headers: parsed.except(*query_params).transform_keys(betas: "anthropic-beta"),
191
+ page: Anthropic::Internal::Page,
192
+ model: Anthropic::Beta::Organization::BetaOrganizationWebhookEndpoint,
193
+ options: {extra_headers: {"anthropic-beta" => "webhooks-2026-10-07"}, **options}
194
+ )
195
+ end
196
+
197
+ # Delete an organization webhook endpoint.
198
+ #
199
+ # Every request must include the beta header
200
+ # `anthropic-beta: webhooks-2026-10-07`. A request without it returns `404`,
201
+ # exactly as if this API did not exist. Anthropic turns organization webhook
202
+ # endpoints on for each organization; until yours is on, requests also return
203
+ # `404`. Organization webhook endpoints are in beta and are not available to
204
+ # organizations with HIPAA readiness enabled.
205
+ #
206
+ # Some parameter documentations has been truncated, see
207
+ # {Anthropic::Models::Beta::Organization::WebhookDeleteParams} for more details.
208
+ #
209
+ # @overload delete(webhook_endpoint_id, betas: nil, request_options: {})
210
+ #
211
+ # @param webhook_endpoint_id [String] ID of the webhook endpoint.
212
+ #
213
+ # @param betas [Array<Symbol, String, Anthropic::Models::AnthropicBeta>] This endpoint is in beta: requests must send `webhooks-2026-10-07` in this heade
214
+ #
215
+ # @param request_options [Anthropic::RequestOptions, Hash{Symbol=>Object}, nil]
216
+ #
217
+ # @return [Anthropic::Models::Beta::Organization::BetaDeletedOrganizationWebhookEndpoint]
218
+ #
219
+ # @see Anthropic::Models::Beta::Organization::WebhookDeleteParams
220
+ def delete(webhook_endpoint_id, params = {})
221
+ parsed, options = Anthropic::Beta::Organization::WebhookDeleteParams.dump_request(params)
222
+ @client.request(
223
+ span_name: Anthropic::Internal::Tracing::SpanName::ORGANIZATION_WEBHOOKS_DELETE,
224
+ span_attributes: {"anthropic.organization.webhook.id" => webhook_endpoint_id},
225
+ span_route: "/v1/organizations/webhooks/{webhook_endpoint_id}",
226
+ method: :delete,
227
+ path: ["v1/organizations/webhooks/%1$s?beta=true", webhook_endpoint_id],
228
+ headers: parsed.transform_keys(betas: "anthropic-beta"),
229
+ model: Anthropic::Beta::Organization::BetaDeletedOrganizationWebhookEndpoint,
230
+ options: {extra_headers: {"anthropic-beta" => "webhooks-2026-10-07"}, **options}
231
+ )
232
+ end
233
+
234
+ # Replace an organization webhook endpoint's signing secret. The old secret stops
235
+ # working immediately. The new secret is returned only in this response.
236
+ #
237
+ # Every request must include the beta header
238
+ # `anthropic-beta: webhooks-2026-10-07`. A request without it returns `404`,
239
+ # exactly as if this API did not exist. Anthropic turns organization webhook
240
+ # endpoints on for each organization; until yours is on, requests also return
241
+ # `404`. Organization webhook endpoints are in beta and are not available to
242
+ # organizations with HIPAA readiness enabled.
243
+ #
244
+ # Some parameter documentations has been truncated, see
245
+ # {Anthropic::Models::Beta::Organization::WebhookRegenerateSigningSecretParams}
246
+ # for more details.
247
+ #
248
+ # @overload regenerate_signing_secret(webhook_endpoint_id, betas: nil, request_options: {})
249
+ #
250
+ # @param webhook_endpoint_id [String] ID of the webhook endpoint.
251
+ #
252
+ # @param betas [Array<Symbol, String, Anthropic::Models::AnthropicBeta>] This endpoint is in beta: requests must send `webhooks-2026-10-07` in this heade
253
+ #
254
+ # @param request_options [Anthropic::RequestOptions, Hash{Symbol=>Object}, nil]
255
+ #
256
+ # @return [Anthropic::Models::Beta::Organization::BetaOrganizationWebhookEndpointSigningSecret]
257
+ #
258
+ # @see Anthropic::Models::Beta::Organization::WebhookRegenerateSigningSecretParams
259
+ def regenerate_signing_secret(webhook_endpoint_id, params = {})
260
+ parsed, options =
261
+ Anthropic::Beta::Organization::WebhookRegenerateSigningSecretParams.dump_request(params)
262
+ @client.request(
263
+ span_name: Anthropic::Internal::Tracing::SpanName::ORGANIZATION_WEBHOOKS_REGENERATE_SIGNING_SECRET,
264
+ span_attributes: {"anthropic.organization.webhook.id" => webhook_endpoint_id},
265
+ span_route: "/v1/organizations/webhooks/{webhook_endpoint_id}/regenerate_signing_secret",
266
+ method: :post,
267
+ path: [
268
+ "v1/organizations/webhooks/%1$s/regenerate_signing_secret?beta=true",
269
+ webhook_endpoint_id
270
+ ],
271
+ headers: parsed.transform_keys(betas: "anthropic-beta"),
272
+ model: Anthropic::Beta::Organization::BetaOrganizationWebhookEndpointSigningSecret,
273
+ options: {extra_headers: {"anthropic-beta" => "webhooks-2026-10-07"}, **options}
274
+ )
275
+ end
276
+
277
+ # @api private
278
+ #
279
+ # @param client [Anthropic::Client]
280
+ def initialize(client:)
281
+ @client = client
282
+ end
283
+ end
284
+ end
285
+ end
286
+ end
287
+ end